proxy_cache fills harddrive despite max_size being set

W-Mark Kubacki wmark+nginx at
Thu Jun 3 13:42:14 MSD 2010

2010/6/2 Igor Sysoev <igor at>:
> On Wed, Jun 02, 2010 at 08:11:53PM +0200, W-Mark Kubacki wrote:
>> In Nginx 0.8.38 (and later; on amd64) I've set this:
>>   proxy_cache_path /var/tmp/nginx/cache levels=1:2
>> keys_zone=my-cache:10m inactive=8h max_size=100m;
>> Using that cache Nginx fills my harddrive with its cache, ignoring max_size.
>> Did somebody else observed that behaviour? Or, did I something wrong?
> What does "du -kcd1 /var/tmp/nginx/cache" show ?

# du -kc --max-depth=1 /var/tmp/nginx/cache

32459364        /var/tmp/nginx/cache/0
32459368        /var/tmp/nginx/cache
32459368        total

My 'du' doesn't feature parameters "d1", I hope --max-depth is the same.

Additionally I've notice that there are several files larger than
100MB in "cache/0/00". Given their content, their first lines are most
probably from the upstream - which is fine - but should neither get
cached at all given max_size nor should the garbage (lots of ^@
following the first kilobytes) be there.

Mark Kubacki

More information about the nginx mailing list