Inner workings of nginx cache manager

Stefan Safar stefan.safar at
Fri Nov 30 13:05:22 UTC 2018


So the cache loader only does something like stat() during the filesystem
walk, which should be fairly fast, unless you have tens/hundreds of
millions of files in cache.

Thanks again!


On Fri, Nov 30, 2018 at 1:58 PM Maxim Dounin <mdounin at> wrote:

> Hello!
> On Fri, Nov 30, 2018 at 01:26:27PM +0100, Stefan Safar wrote:
> > So the process/thread that scans through the files on disk need to read
> the
> > all the file headers to find the KEY for the all cache files to keep the
> > information in memory before it starts deleting anything, is that
> correct?
> No, cache loader only scans which files are present in the cache
> (and their sizes), it doesn't try to read them.  Raw keys as
> stored in cache file headers are only needed for a safety check to
> make sure there are no MD5 collissions between different keys, and
> this check only happens when returning an actual response from the
> cache.
> --
> Maxim Dounin
> _______________________________________________
> nginx mailing list
> nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list