Multiple nginx instances share same proxy cache storage

Maxim Dounin mdounin at
Mon Aug 11 10:18:31 UTC 2014


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

More information about the nginx mailing list