Multiple nginx instances share same proxy cache storage

ThomasLohner nginx-forum at nginx.us
Thu Dec 25 13:02:44 UTC 2014


Hi,


> Hello!
> 
> On Sun, Aug 10, 2014 at 05:24:04PM -0700, Robert Paprocki wrote:
> 
> > Any options then to support an architecture with multiple nginx 
> > nodes sharing or distributing a proxy cache between them? i.e., 
> > a HAProxy machine load balances to several nginx nodes (for 
> > failover reasons), and each of these nodes handles http proxy + 
> > proxy cache for a remote origin? If nginx handles cache info in 
> > memory, it seems that multiple instances could not be used to 
> > maintain the same cache info (something like rsyncing the cache 
> > contents between nodes thus would not work); are there any 
> > recommendations to achieve such a solution?
> 
> Distinct caches will be best from failover point of view.
> 
> To maximize cache effeciency, you may consider using URI-based 
> hashing to distribute requests between cache nodes.
> 
> -- 
> Maxim Dounin
> http://nginx.org/


I wonder if it would hurt to make nginx load cache metadata from file as a
fallback only if there's no entry in the keys_zone. If this would be a param
for proxy_cache_path we could build a distributed cache cluster by simply
copying cache files to other nodes.  Making this a param would not hut
performance if you don't want this behavior. The functionality is already
there, because nginx loads metadata from files on startup.

Is this a valid feature request or does no one care aboout clustering nginx
caches?

-- 
Thomas

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,252275,255788#msg-255788



More information about the nginx mailing list