proxy_cache_path question

Igor Sysoev igor at
Thu Apr 29 15:54:37 MSD 2010

On Thu, Apr 29, 2010 at 11:24:51AM +0200, Marlon de Boer wrote:

> Hi list,
> I'm trying to limit the amount of data nginx caches but can't get it to
> work properly.
> I'm using the following line to limit the cache:
> proxy_cache_path /var/tmp/nginx/cache levels=1:2 keys_zone=cache:32m
> inactive=1440 max_size=32m;
> Is my assumption correct that this cache cannot grow any bigger than
> 32Mb? What I see in my case is /var/tmp/nginx/cache grows well above
> 32Mb (in my test I've seen 46Mb).
> Does anybody has a suggestion to get the cache limit to work?

It may be bigger at least for two reasons:
1) nginx counts only file size rounded to file system block size.
   For example, on UFS it's fragment size.
   As I understand, "du" counts in 1K blocks.
2) levels=1:2 means that nginx will create at least 8M directory hierarchy.

Igor Sysoev

More information about the nginx mailing list