Welcome! Log In Create A New Profile

Advanced

NGINX stale-while-revalidate cluster

All files from this thread

File Name File Size   Posted by Date  
olhgllimkponlhjm.gif 4.1 KB open | download Joan Tomàs i Buliart 07/07/2017 Read message
olhgllimkponlhjm.gif 4.1 KB open | download Lucas Rolff 07/07/2017 Read message
Joan Tomàs i Buliart
July 07, 2017 05:54AM
Hi,

We are implementing an stale-while-revalidate webserver cluster with NGINX.

We are using the new proxy_cache_background_update to answer request as
soon as possible while NGINX updates the content from the origin in the
background. This solution works perfectly when the requests for the same
object are served by the same NGINX server (when we have only one server
or when we have a previous load balancer that classifies the requests).

In our scenario we have a round robin load balancer (ELB) and we need to
scale the webservers layer. So, as a consequence, only the Nginx that
receive the request updates the cache content while the others keep the
old version. This means that, we can send old versions of content due to
the content not being updated on all the webservers. The problem
accentuates when we put a CDN in front of the webservers.

We are thinking on developing something that once an Nginx instance
updates its cache would let know all other instances to get a copy of
the newest content. We are thinking about processing NGINX logs and,
when it detects a MISS, EXPIRED or UPDATING cache status, it makes a
HEAD request to the other NGINXs on the cluster to force the
invalidation of this content.


Do any of you have dealt with this problem or a similar one?

We have also tried the post_action but it is blocking the client request
until it completes. It is not clear for us which would be the best
approach. The options that we are considering are:

- NGINX module
- LUA script
- External script that process syslog entries from NGINX

What would be your recommendation?

Many thanks in advance,


--
Joan Tomàs-Buliart
www.marfeel.com http://www.marfeel.com
Joan Tomàs-Buliart
+34 931 785 950
www.marfeel.com http://www.marfeel.com
Discover our referral program!!
http://blog.marfeel.com/earn-money-marfeel-referral-program/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Attachments:
open | download - olhgllimkponlhjm.gif (4.1 KB)
Subject Author Posted

NGINX stale-while-revalidate cluster Attachments

Joan Tomàs i Buliart July 07, 2017 05:54AM

Re: NGINX stale-while-revalidate cluster Attachments

Lucas Rolff July 07, 2017 06:14AM

Re: NGINX stale-while-revalidate cluster

Joan Tomàs i Buliart July 07, 2017 06:32AM

Re: NGINX stale-while-revalidate cluster

frank3427 July 07, 2017 09:26AM

Re: NGINX stale-while-revalidate cluster

pbooth July 07, 2017 09:40AM

Re: NGINX stale-while-revalidate cluster

oweng July 07, 2017 10:06AM

Re: NGINX stale-while-revalidate cluster

Joan Tomàs i Buliart July 08, 2017 09:02AM

Re: NGINX stale-while-revalidate cluster

pbooth July 08, 2017 09:32AM

Re: NGINX stale-while-revalidate cluster

Joan Tomàs i Buliart July 08, 2017 04:30PM

Re: NGINX stale-while-revalidate cluster

pbooth July 09, 2017 05:00PM

Re: NGINX stale-while-revalidate cluster

Maxim Dounin July 10, 2017 08:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready