Welcome! Log In Create A New Profile

Advanced

RE: STALE responses taking as much as MISS responses

All files from this thread

File Name File Size   Posted by Date  
badge-and-logo.png 10.4 KB open | download Joan Tomàs i Buliart 02/12/2019 Read message
Reinis Rozitis
February 12, 2019 03:10PM
> after applying tcp_nopush off, the test that we have in place is working as expected. The problem is that this improvement is not happening on production.
Our production environment is mainly a CDN -> NGinx -> Origin. We want to use Nginx in order to control the eviction time of the content (our use case needs a long stale-while-revalidate time and CDN priorizes fresh content instead of stale). Our CDN give us the latency of our NGINX and after apply the change, we are not able to see any improvement. We have decided to put an ELB in front of Nginx, just to have another way to measure, and we can see the same behaviour.



In case of CDN -> nginx -> Origin does the latency appear also for HIT queries or only STALE?

If you take out nginx and use CDN -> Origin what latency do you see then?

Obviously if your CDN doesn't cache anything then all those will be like MISS requests, but maybe you can identify/measure if the CDN itself doesn't add noticeable extra time (depending on the setup - like if there is SSL offloading (and on which end it happens). Some CDNs also use nginx as edge servers (for example CloudFlare used to have a modified version) so maybe in some configurations the usage of TCP_CORK is still in effect.


> On the other hand, we saw that $request_time, when STALE, is the time to refresh the cache, not the time to return the STALE content.
> Could somebody confirm this? Which could be the metric to measure the real "latency" from the user point of view (in our case CDN)?

$request_time represents "time elapsed between the first bytes were read from the client and the log write after the last bytes were sent to the client".
So it will show the time between the request coming from the CDN edge server and served back to it. In case the object is fetched from backend/updated synchronously it will include the time spent on that.

For more detailed picture you could also log $upstream_connect_time and $upstream_response_time to see how long it takes for nginx to get the response from backend and then compare with the timings you get on the client (curl) when requesting via CDN or directly.

rr

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

STALE responses taking as much as MISS responses

joao.pereira February 11, 2019 09:59AM

Re: STALE responses taking as much as MISS responses

joao.pereira February 11, 2019 10:06AM

Re: STALE responses taking as much as MISS responses

Peter Booth via nginx February 11, 2019 02:02PM

Re: STALE responses taking as much as MISS responses

Peter Booth via nginx February 11, 2019 02:28PM

Re: STALE responses taking as much as MISS responses

joao.pereira February 12, 2019 05:54AM

RE: STALE responses taking as much as MISS responses

Reinis Rozitis February 12, 2019 07:08AM

Re: STALE responses taking as much as MISS responses Attachments

Joan Tomàs i Buliart February 12, 2019 01:32PM

RE: STALE responses taking as much as MISS responses

Reinis Rozitis February 12, 2019 03:10PM

Re: RE: STALE responses taking as much as MISS responses

joao.pereira February 15, 2019 12:54PM

Re: RE: STALE responses taking as much as MISS responses

Maxim Dounin February 18, 2019 07:46AM

RE: STALE responses taking as much as MISS responses

Reinis Rozitis February 11, 2019 02:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 186
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