Proxy_cache and restarts


#1

Hello,

I have a question on for nginx handles restarts and proxy_cache.

Say I have 2 million objects cached, taking up 50GBs of space. Then I
get a kernel panic or some other error, and have to restart the physical
machine.

When I start nginx up again the 2 million objects are still on the disk,
but nginx no longer has its internal caching table, correct? Are those
files just stuck on the disk forever, or do I need to ensure the cache
is empty if nginx needs to be restarted by manually deleting the
objects?

Also on binary upgrades, will the internal proxy cache table survive?

Thanks,

John


#2

On Sat, May 02, 2009 at 11:53:18AM -0500, Resicow wrote:

files just stuck on the disk forever, or do I need to ensure the cache
is empty if nginx needs to be restarted by manually deleting the objects?

While starting up workers look up disk cache on demand and update keys
zones in shared memory. Also the cache manager process runs in
background,
reads step by step a whole disk cache, and updates the keys zones, too.
After cache manager has read (it may take a long time for 50G) a whole
disk cache, workers use only keys zones to look up existence of
responses.
Upon that the cache manager now delete inactive responses and looks
after
disk cache size.

Also on binary upgrades, will the internal proxy cache table survive?

Since keys zones are not shared between old and new processes, the new
workers and cache manager does the same as on start up.


#3

Sounds very intelligent, and good to know the cache won’t need to be
deleted.

We are using this to cache small images, and we plan on pushing this to
multi-millions of individual files, and about a TB of storage, so I’ll
let you know what type of performance we see under those conditions at
startup time.

Thanks,

John


#4

We are using this to cache small images, and we plan on pushing this to
multi-millions of individual files, and about a TB of storage, so I’ll let
you know what type of performance we see under those conditions at startup
time.

Hey,

I’m planning to use Nginx in a similar environment, so your experience
would be very valuable to me. Could you tell me when will you perform
any experiments?

Best wishes,

Mike