# Cache keeps growing despite Max\_size limit

**URL:** <https://www.ruby-forum.com/t/cache-keeps-growing-despite-max-size-limit/227175>\
**Category:** NGINX\
**Created:** [March 6, 2013, 1:02pm UTC](https://www.ruby-forum.com/t/cache-keeps-growing-despite-max-size-limit/227175 "2013-03-06T13:02:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan-34](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ccd318/32.png) [@Jan-34](https://www.ruby-forum.com/u/Jan-34)\
**Post date:** [March 6, 2013, 1:02pm UTC](https://www.ruby-forum.com/t/cache-keeps-growing-despite-max-size-limit/227175/1 "2013-03-06T13:02:45Z")

</div>

Hi,

I’m having issues with nginx where my cache directory keeps growing  
until  
the hdd is full.  
If anyone can give me any information on how to solve this it will be  
appreciated.

nginx -V:

nginx version: nginx/1.2.1  
built by gcc 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC)  
TLS SNI support enabled  
configure arguments: --prefix=/usr/share/nginx  
–sbin-path=/usr/sbin/nginx  
–conf-path=/etc/nginx/nginx.conf  
–error-log-path=/var/log/nginx/error.log  
–http-log-path=/var/log/nginx/access.log  
–http-client-body-temp-path=/var/lib/nginx/tmp/client\_body  
–http-proxy-temp-path=/var/lib/nginx/tmp/proxy  
–http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi  
–http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi  
–http-scgi-temp-path=/var/lib/nginx/tmp/scgi  
–pid-path=/var/run/nginx.pid  
–lock-path=/var/lock/subsys/nginx --user=nginx --group=nginx  
–with-file-aio --with-ipv6 --with-http\_ssl\_module  
–with-http\_realip\_module  
–with-http\_addition\_module --with-http\_sub\_module  
–with-http\_dav\_module  
–with-http\_flv\_module --with-http\_mp4\_module  
–with-http\_gzip\_static\_module  
–with-http\_random\_index\_module --with-http\_secure\_link\_module  
–with-http\_degradation\_module --with-http\_stub\_status\_module  
–with-http\_perl\_module --with-mail --with-mail\_ssl\_module  
–add-module=/root/nginx-1.2.1/ngx\_slowfs\_cache-1.9  
–add-module=/root/nginx-1.2.1/nginx-sticky-module-1.0

nginx.conf:  
user apache;

worker\_processes 4;

error\_log /var/log/nginx/error.log emerg;  
pid /var/run/nginx.pid;

worker\_rlimit\_nofile 30000;

events {  
worker\_connections 8192;  
use epoll;  
multi\_accept off;  
}

http {  
include /etc/nginx/mime.types;

```
    sendfile on;

    gzip on;
    gzip_min_length 10;
    gzip_types text/plain text/css image/png image/gif

```

image/jpeg application/x-javascript text/xml  
application/xml application/xml+rss  
text/javascript application/javascript;  
gzip\_vary on;  
gzip\_comp\_level 9;  
gzip\_proxied any;  
gzip\_disable msie6;

```
    tcp_nodelay off;

    log_format '$remote_addr - $remote_user 

```

[$time\_local]’  
'“$request” $status $bytes\_sent ’  
‘“$http\_referer” “$http\_user\_agent”  
“$gzip\_ratio”’;

```
    slowfs_cache_path /var/cache/nginx/cache levels=1:2

```

keys\_zone=fastcache:4096m max\_size=25g;  
slowfs\_temp\_path /var/cache/nginx/temp 1 2;

```
    proxy_buffer_size 128k;
    proxy_buffers 4 256k;
    proxy_busy_buffers_size 256k;

    include /etc/nginx/sites-enabled/*;

```

}

Posted at Nginx Forum:

> **[Cache keeps growing despite Max\_size limit](https://forum.nginx.org/read.php?2,236987,236987#msg-236987)**
>
> Hi, I'm having issues with nginx where my cache directory keeps growing until the hdd is full. If anyone can give me any information on how to solve this it will be appreciated. nginx -V: nginx version: nginx/1.2.1 built by gcc 4.4.6 2011073

---

<div class="post-metadata">

**Author:** ![Jan-34](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ccd318/32.png) [@Jan-34](https://www.ruby-forum.com/u/Jan-34)\
**Post date:** [March 6, 2013, 1:13pm UTC](https://www.ruby-forum.com/t/cache-keeps-growing-despite-max-size-limit/227175/2 "2013-03-06T13:13:52Z")

</div>

Hello!

On Wed, Mar 06, 2013 at 07:02:28AM -0500, jan5134 wrote:

> built by gcc 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC)  
> –with-file-aio --with-ipv6 --with-http\_ssl\_module --with-http\_realip\_module
> 
> ```
> multi_accept off;
> 
> ```
> 
> image/jpeg application/x-javascript text/xml  
> '“$request” $status $bytes\_sent ’
> 
> ```
> include /etc/nginx/sites-enabled/*;
> 
> ```
> 
> }

As a quick test you may try switching to a proxy + proxy\_cache  
setup instead of slowfs\_cache to see if slowfs\_cache module  
problem or something more general.

–  
Maxim D.  
[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)

---

<div class="post-metadata">

**Author:** ![Jan-34](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ccd318/32.png) [@Jan-34](https://www.ruby-forum.com/u/Jan-34)\
**Post date:** [March 6, 2013, 1:17pm UTC](https://www.ruby-forum.com/t/cache-keeps-growing-despite-max-size-limit/227175/3 "2013-03-06T13:17:22Z")

</div>

Thanks for the quick reply.

I would like to test that but i’m kind of new to nginx and also our  
website  
can’t have any downtime.  
Any other suggestion maybe?

Posted at Nginx Forum:

> **[Re: Cache keeps growing despite Max\_size limit](https://forum.nginx.org/read.php?2,236987,236989#msg-236989)**
>
> Hi, I'm having issues with nginx where my cache directory keeps growing until the hdd is full. If anyone can give me any information on how to solve this it will be appreciated. nginx -V: nginx version: nginx/1.2.1 built by gcc 4.4.6 2011073

---

<div class="post-metadata">

**Author:** ![Jan-34](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ccd318/32.png) [@Jan-34](https://www.ruby-forum.com/u/Jan-34)\
**Post date:** [March 7, 2013, 12:20am UTC](https://www.ruby-forum.com/t/cache-keeps-growing-despite-max-size-limit/227175/4 "2013-03-07T00:20:38Z")

</div>

Hey,

> As a quick test you may try switching to a proxy + proxy\_cache  
> setup instead of slowfs\_cache to see if slowfs\_cache module  
> problem or something more general.

It’s a known issue with my ngx\_slowfs\_cache module.

Best regards,  
Piotr S. \< removed\_email\_address@domain.invalid \>

---

<div class="post-metadata">

**Author:** ![Jan-34](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ccd318/32.png) [@Jan-34](https://www.ruby-forum.com/u/Jan-34)\
**Post date:** [March 7, 2013, 6:47am UTC](https://www.ruby-forum.com/t/cache-keeps-growing-despite-max-size-limit/227175/5 "2013-03-07T06:47:47Z")

</div>

Hi,

Thanks for your contribution to the nginx community Piotr and your  
reply.  
Do you have any suggestions on how to bypass this problem?  
Any update on the module in the near future that might fix this issue?

Thanks  
Jan

Posted at Nginx Forum:

> **[Re: Cache keeps growing despite Max\_size limit](https://forum.nginx.org/read.php?2,236987,237036#msg-237036)**
>
> Hi, I'm having issues with nginx where my cache directory keeps growing until the hdd is full. If anyone can give me any information on how to solve this it will be appreciated. nginx -V: nginx version: nginx/1.2.1 built by gcc 4.4.6 2011073

---

<div class="post-metadata">

**Author:** ![Jan-34](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ccd318/32.png) [@Jan-34](https://www.ruby-forum.com/u/Jan-34)\
**Post date:** [March 6, 2013, 1:28pm UTC](https://www.ruby-forum.com/t/cache-keeps-growing-despite-max-size-limit/227175/6 "2013-03-06T13:28:28Z")

</div>

Hello!

On Wed, Mar 06, 2013 at 07:16:39AM -0500, jan5134 wrote:

> Thanks for the quick reply.
> 
> I would like to test that but i’m kind of new to nginx and also our website  
> can’t have any downtime.  
> Any other suggestion maybe?

Try to reproduce the problem in a sandbox, it should help with  
your downtime concerns.

I’m also not sure if Piotr S., author of the slowfs cache  
module, is reading this list on a regular basis, so you may want  
to CC him once you have some data to work with.

–  
Maxim D.  
[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)

---

<div class="post-metadata">

**Author:** ![Jan-34](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ccd318/32.png) [@Jan-34](https://www.ruby-forum.com/u/Jan-34)\
**Post date:** [March 7, 2013, 3:10pm UTC](https://www.ruby-forum.com/t/cache-keeps-growing-despite-max-size-limit/227175/7 "2013-03-07T15:10:17Z")

</div>

Thanks for that quick update Piotr.  
Will start with the testing on a new server that i’ll set up and let you  
know if there is anything else.

Thanks  
Jan

Posted at Nginx Forum:

> **[Re: Cache keeps growing despite Max\_size limit](https://forum.nginx.org/read.php?2,236987,237065#msg-237065)**
>
> Hi, I'm having issues with nginx where my cache directory keeps growing until the hdd is full. If anyone can give me any information on how to solve this it will be appreciated. nginx -V: nginx version: nginx/1.2.1 built by gcc 4.4.6 2011073

---

<div class="post-metadata">

**Author:** ![Jan-34](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ccd318/32.png) [@Jan-34](https://www.ruby-forum.com/u/Jan-34)\
**Post date:** [March 7, 2013, 2:31pm UTC](https://www.ruby-forum.com/t/cache-keeps-growing-despite-max-size-limit/227175/8 "2013-03-07T14:31:08Z")

</div>

Hey Jan,

> Any update on the module in the near future that might fix this issue?

Latest release shouldn’t have this problem:  
[http://labs.frickle.com/files/ngx\_slowfs\_cache-1.10.tar.gz](http://labs.frickle.com/files/ngx_slowfs_cache-1.10.tar.gz)

Best regards,  
Piotr S. \< removed\_email\_address@domain.invalid \>
