Welcome! Log In Create A New Profile

Advanced

Re: Multiple nginx instances share same proxy cache storage

Robert Paprocki
August 10, 2014 08:26PM
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?

> On Aug 4, 2014, at 17:49, Maxim Dounin <mdounin@mdounin.ru> wrote:
>
> Hello!
>
>> On Mon, Aug 04, 2014 at 07:42:20PM -0400, badtzhou wrote:
>>
>> I am thinking about setting up multiple nginx instances share single proxy
>> cache storage using NAS, NFS or some kind of distributed file system. Cache
>> key will be the same for all nginx instances.
>> Will this theory work? What kind of problem will it cause(locking, cached
>> corruption or missing metadata in the memory)?
>
> As soon as a cache is loaded, nginx relies on it's memory data to
> manage cache (keep it under the specified size, remove inactive
> items and so on). As a result it won't be happy if you'll try to run
> multiple nginx instances working with the same cache directory.
> It can tolerate multiple instances working with the same cache for
> a short period of time (e.g., during binary upgrade). But running
> nginx this way intentionally is a bad idea.
>
> Besides, using NFS (as well as other NASes) for nginx cache is a
> bad idea due to blocking file operations.
>
> --
> Maxim Dounin
> http://nginx.org/
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

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

Multiple nginx instances share same proxy cache storage

badtzhou August 04, 2014 07:42PM

Re: Multiple nginx instances share same proxy cache storage

Maxim Dounin August 04, 2014 08:50PM

Re: Multiple nginx instances share same proxy cache storage

Robert Paprocki August 10, 2014 08:26PM

Re: Multiple nginx instances share same proxy cache storage

itpp2012 August 11, 2014 05:37AM

Re: Multiple nginx instances share same proxy cache storage

Maxim Dounin August 11, 2014 06:20AM

Re: Multiple nginx instances share same proxy cache storage

ThomasLohner December 25, 2014 08:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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