# Proxy\_cache fills harddrive despite max\_size being set

**URL:** <https://www.ruby-forum.com/t/proxy-cache-fills-harddrive-despite-max-size-being-set/189545>\
**Category:** NGINX\
**Created:** [June 2, 2010, 8:46pm UTC](https://www.ruby-forum.com/t/proxy-cache-fills-harddrive-despite-max-size-being-set/189545 "2010-06-02T20:46:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![W-Mark\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@W-Mark\_K](https://www.ruby-forum.com/u/W-Mark_K)\
**Post date:** [June 2, 2010, 8:46pm UTC](https://www.ruby-forum.com/t/proxy-cache-fills-harddrive-despite-max-size-being-set/189545/1 "2010-06-02T20:46:26Z")

</div>

Hello.

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?

–  
Thanks fÃ¼r your help in advance!  
Mark

> **[Ossdl](https://ossdl.de/)**
>
> Blog

---

<div class="post-metadata">

**Author:** ![W-Mark\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@W-Mark\_K](https://www.ruby-forum.com/u/W-Mark_K)\
**Post date:** [June 2, 2010, 8:58pm UTC](https://www.ruby-forum.com/t/proxy-cache-fills-harddrive-despite-max-size-being-set/189545/2 "2010-06-02T20:58:44Z")

</div>

On Wed, Jun 02, 2010 at 08:11:53PM +0200, W-Mark K. 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 ?

–  
Igor S.

> **[Igor Sysoev](http://sysoev.ru/en/)**

---

<div class="post-metadata">

**Author:** ![W-Mark\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@W-Mark\_K](https://www.ruby-forum.com/u/W-Mark_K)\
**Post date:** [June 17, 2010, 4:22pm UTC](https://www.ruby-forum.com/t/proxy-cache-fills-harddrive-despite-max-size-being-set/189545/3 "2010-06-17T16:22:35Z")

</div>

Why has this problem not be addressed?

+1bump

Happening to me to, 33M folder in cache when I set to 10M

Posted at Nginx Forum:

> **[Re: proxy\_cache fills harddrive despite max\_size being set](https://forum.nginx.org/read.php?2,93698,98079#msg-98079)**
>
> Hello. 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 somebod

---

<div class="post-metadata">

**Author:** ![W-Mark\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@W-Mark\_K](https://www.ruby-forum.com/u/W-Mark_K)\
**Post date:** [June 30, 2010, 6:01pm UTC](https://www.ruby-forum.com/t/proxy-cache-fills-harddrive-despite-max-size-being-set/189545/4 "2010-06-30T18:01:51Z")

</div>

I’m seeing something similar. du -sb returns 1411480500 bytes, even  
though I have specified 1024 MB as max size.

nginx 0.7.62 on ubuntu 9.10 server.

Here is my proxy\_cache config:  
proxy\_cache\_path /var/spool/nginx\_proxy\_cache  
levels=1:2  
keys\_zone=zone1:10m  
inactive=7d  
max\_size=1024m;

Any ideas? Is it the inactive period of 7d that controls when the  
cache manager process runs or something?

–  
RPM

---

<div class="post-metadata">

**Author:** ![W-Mark\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b9bd4f/32.png) [@W-Mark\_K](https://www.ruby-forum.com/u/W-Mark_K)\
**Post date:** [June 3, 2010, 11:43am UTC](https://www.ruby-forum.com/t/proxy-cache-fills-harddrive-despite-max-size-being-set/189545/5 "2010-06-03T11:43:46Z")

</div>

2010/6/2 Igor S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> 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 K.

> **[Open Source Software Entwicklung Heidelberg | OSSDL](https://ossdl.de/)**
>
> OSSDL — Open Source Software Development Labs Heidelberg. Softwareentwicklung, Architektur, Linux und DevOps auf Basis offener Technologien.
