Inner workings of nginx cache manager

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


Hi!

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!

Stefan

On Fri, Nov 30, 2018 at 1:58 PM Maxim Dounin <mdounin at mdounin.ru> 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
> http://mdounin.ru/
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20181130/0d9db454/attachment.html>


More information about the nginx mailing list