Igor Sysoev is at
Wed Aug 19 10:19:00 MSD 2009

On Wed, Aug 19, 2009 at 12:48:12AM -0400, Jim Ohlstein wrote:

> Igor Sysoev wrote:
> >Changes with nginx 0.8.9                                         17 Aug 
> >2009
> >
> >    *) Feature: now the start cache loader runs in a separate process; 
> >    this should improve large caches handling.
> >  
> Can you briefly explain the function of cache manager and cache loader 
> processes?

Cache loader starts to work 60s later after nginx starts or was reconfigured.
It may run for long time on large cache: even hours. After all caches
will be loaded the cache loader exits. When nginx was reconfigured then
new cache loader tests if a cache already has been loading. If so, then 
the new loader goes to the next cache. So for large caches you may see
two or more cache loader processes while reconifurations.

Cache manager starts to work just after nginx starts or was reconfigured.
It deletes inactive cache entries and checks caches size.

Before 0.8.9 there was only cache manager process that at first loaded
cache and then started to manage it. For large caches the caches were
not managed before they will be completely loaded. Besides, if nginx
was reconcifgured while it was loading caches, then a new cache manager
started to load them from the very start: you will see two cache manager
processes do the same thing.

> >    *) Feature: now temporarily files and permanent storage area may 
> >    reside at different file systems.
> In the past files were moved from temporary system to cache with hard 
> links if I am not mistaken. Does this mean that each file will now be 
> written separately? Won't that have a negative impact on disk I/O on a 
> busy system?

Now they are just renamed(2)ed too. However, if rename() fails with EXDEV
error, then nginx copies temporary file to permanent_name.random_number
and then rename(2)s the permanent_name.random_number to just permanent_name.

I see two usages of different temporary and permanent storage:

1) permanent storage has serveral mount points to different disks.
2) permanent storage is SSD.

Igor Sysoev

More information about the nginx mailing list