STALE responses taking as much as MISS responses
joao.pereira
nginx-forum at forum.nginx.org
Tue Feb 12 10:54:27 UTC 2019
Hi Peter and Reinis,
I do have have a lot of cache, currently I have ~45 millions of keys and its
the beginning of our tests which I believe will get close to the 80 million
you say.
I will add some tests I have done, I set up flash (a python framework) that
delays a response for 5 second then I do the request using my nginx as a
proxy.
The max-age is set to 1 second to force nginx to go to the backend, this
plus the 5 seconds delay allow me to see both STALE and an UPDATING
responses.
What I can see is that, the first request after max-age expiration is a
STALE and it takes much more time than the next request which is an
UPDATING.
See bellow:
root at ip-127.0.0.1:~# curl -w
"%{time_connect}:%{time_appconnect}:%{time_pretransfer}:%{time_redirect}:%{time_starttransfer}:%{time_total}\n"
-D - -s -o /dev/null -H "host: flask-instance.com" -H "origin:
flask-instance.com" http://localhost:6081/flask-instance.com/flask
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 12 Feb 2019 10:29:36 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 12
Connection: keep-alive
Device: Mobile
CDNOrigin: Mobile
Cache-Control: max-age=1, stale-while-revalidate=60
X-MShield-Cache-Status: STALE
0.004329:0.000000:0.004364:0.000000:0.212526:0.212644
root at ip-127.0.0.1:~# curl -w
"%{time_connect}:%{time_appconnect}:%{time_pretransfer}:%{time_redirect}:%{time_starttransfer}:%{time_total}\n"
-D - -s -o /dev/null -H "host: flask-instance.com" -H "origin:
flask-instance.com" http://localhost:6081/flask-instance.com/flask
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 12 Feb 2019 10:29:38 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 12
Connection: keep-alive
Device: Mobile
CDNOrigin: Mobile
Cache-Control: max-age=1, stale-while-revalidate=60
X-MShield-Cache-Status: UPDATING
0.004289:0.000000:0.004315:0.000000:0.004574:0.004691
The request is always returning a '200' with 5 seconds delay, which mean
that both responses would have (in theory) the same response time.
Posted at Nginx Forum: https://forum.nginx.org/read.php?2,282984,283021#msg-283021
More information about the nginx
mailing list