Welcome! Log In Create A New Profile

Advanced

Re: Is cache being used?

July 26, 2011 12:23PM
The more I test, the more confused I am :-(
I'm using httperf tool to make performance testing, and when I launch a 10 requests test, I see 10 responses in nginx logs with code 200, but I also see the same 10 responses with 200 code in backend 'real' server.
Why is it asking backend servers again if it already has a 200 response for the same request?

Please, help me understand it.

I am using these settings:

---
## Proxy options
proxy_buffering on;
proxy_cache_min_uses 3;
proxy_cache_valid any 10m;
proxy_ignore_client_abort off;
proxy_intercept_errors on;
proxy_next_upstream error timeout invalid_header;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 60;
proxy_send_timeout 60;
proxy_read_timeout 60;

## Cache Paths
proxy_cache_path /usr/local/nginx/cache/common levels=1:2 keys_zone=cache:10m inactive=10m max_size=1000M;

server {
server_name example.com www.example.com;
access_log /var/log/nginx/example.access.log;
location / {
proxy_pass http://11.22.33.44:80;
proxy_cache cache;
proxy_cache_valid 200 1d;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;

}
}
---

==> /var/log/nginx/example.access.log <== (frontend server)
10.11.12.13 - - [26/Jul/2011:18:16:07 +0200] "GET / HTTP/1.1" 200 103124 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:07 +0200] "GET / HTTP/1.1" 200 103124 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:07 +0200] "GET / HTTP/1.1" 200 103124 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:07 +0200] "GET / HTTP/1.1" 200 103124 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:08 +0200] "GET / HTTP/1.1" 200 103124 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:08 +0200] "GET / HTTP/1.1" 200 103124 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:08 +0200] "GET / HTTP/1.1" 200 103124 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:08 +0200] "GET / HTTP/1.1" 200 103124 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:08 +0200] "GET / HTTP/1.1" 200 103124 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:09 +0200] "GET / HTTP/1.1" 200 103124 "-" "httperf/0.9.0"

==> /var/log/httpd/example.access.log <== (backend server)
10.11.12.13 - - [26/Jul/2011:18:16:06 +0200] "GET / HTTP/1.0" 200 103606 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:06 +0200] "GET / HTTP/1.0" 200 103606 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:07 +0200] "GET / HTTP/1.0" 200 103606 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:07 +0200] "GET / HTTP/1.0" 200 103606 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:06 +0200] "GET / HTTP/1.0" 200 103606 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:06 +0200] "GET / HTTP/1.0" 200 103606 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:06 +0200] "GET / HTTP/1.0" 200 103606 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:07 +0200] "GET / HTTP/1.0" 200 103606 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:06 +0200] "GET / HTTP/1.0" 200 103606 "-" "httperf/0.9.0"
10.11.12.13 - - [26/Jul/2011:18:16:07 +0200] "GET / HTTP/1.0" 200 103606 "-" "httperf/0.9.0"
Subject Author Posted

Is cache being used?

egrueda July 26, 2011 11:54AM

Re: Is cache being used?

egrueda July 26, 2011 12:23PM

Re: Is cache being used?

Ben Lancaster July 26, 2011 12:28PM

Re: Is cache being used?

egrueda July 27, 2011 09:38AM

Re: Is cache being used?

Ben Lancaster July 27, 2011 12:54PM

Re: Is cache being used?

egrueda July 28, 2011 02:19AM

Re: Is cache being used?

Ben Lancaster July 28, 2011 03:36AM

Re: Is cache being used?

Igor Sysoev July 28, 2011 03:50AM

Re: Is cache being used?

egrueda July 28, 2011 04:09AM

Re: Is cache being used?

sureshvv October 21, 2011 04:55AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 289
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready