nginx cache loader process
mdounin at mdounin.ru
Wed Jul 10 11:53:31 UTC 2013
On Tue, Jul 09, 2013 at 07:50:32PM -0400, badtzhou wrote:
> We are running nginx 1.2.9. What will happen if cache loader is running. The
> file on disk haven't been loaded into the cache zone yet and someone try to
> access the same file. Will it cause any issue? How will it affect cache
> loader process.
If the cache isn't yet loaded, nginx will try to check if a cache
file is there by a looking into disk directly from a worker
process. That is, it will work without problems and will use
cached responses, but will be slightly less effective.
> If I don't want any file on the disk to be loaded, can I simply kill the
> cache loader process? Will that cause any problem?
It's not a good idea. In a worst case, if you'll kill it with
kill -9 at a wrong time, shared memory zone will be corrupted,
resulting in completely non-working nginx.
If cache loader causes too high load on your server, may want to
tune it's settings to make it less aggressive. See
http://nginx.org/r/proxy_cache_path for details.
More information about the nginx