# How nginx cache manager delete file cached on disk

**URL:** <https://www.ruby-forum.com/t/how-nginx-cache-manager-delete-file-cached-on-disk/222054>\
**Category:** NGINX\
**Created:** [August 10, 2012, 4:02am UTC](https://www.ruby-forum.com/t/how-nginx-cache-manager-delete-file-cached-on-disk/222054 "2012-08-10T04:02:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [August 10, 2012, 4:02am UTC](https://www.ruby-forum.com/t/how-nginx-cache-manager-delete-file-cached-on-disk/222054/1 "2012-08-10T04:02:41Z")

</div>

We used nginx proxy to cache lots of static files. Our monitoring tool  
showed that the write I/O on the server spike once a day on 4am GMT time  
and server will slow down significantly because of the high IO. I  
couldn’t  
find any cron that can cause this. I am guessing it might be the nginx  
cache manager was clearing the disk cache once a day.

We have cache setting like: proxy\_cache\_path /cache levels=2:2:2  
keys\_zone=cache:2000m inactive=1d max\_size=400000m;

Any idea? Thanks!

---

<div class="post-metadata">

**Author:** ![Don\_Zhou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ecc23a/32.png) [@Don\_Zhou](https://www.ruby-forum.com/u/Don_Zhou)\
**Post date:** [August 10, 2012, 11:03am UTC](https://www.ruby-forum.com/t/how-nginx-cache-manager-delete-file-cached-on-disk/222054/2 "2012-08-10T11:03:57Z")

</div>

Hello!

On Thu, Aug 09, 2012 at 07:02:13PM -0700, Don Zhou wrote:

> We used nginx proxy to cache lots of static files. Our monitoring tool  
> showed that the write I/O on the server spike once a day on 4am GMT time  
> and server will slow down significantly because of the high IO. I couldn’t  
> find any cron that can cause this. I am guessing it might be the nginx  
> cache manager was clearing the disk cache once a day.

No, it’s not nginx cache manager. It removes files as soon as  
they become inactive and/or max\_size reached.

> We have cache setting like: proxy\_cache\_path /cache levels=2:2:2  
> keys\_zone=cache:2000m inactive=1d max\_size=400000m;
> 
> Any idea? Thanks!

Something like “top -mio” / iotop might be helpfull. Time  
suggests most likely it’s some daily periodic task.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Don\_Zhou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ecc23a/32.png) [@Don\_Zhou](https://www.ruby-forum.com/u/Don_Zhou)\
**Post date:** [August 10, 2012, 10:03pm UTC](https://www.ruby-forum.com/t/how-nginx-cache-manager-delete-file-cached-on-disk/222054/3 "2012-08-10T22:03:47Z")

</div>

You right! I found it! It is the mlocate.cron come with centos install.  
It  
basic run updatedb on the file system and set the nice to be +19. I have  
so  
many files in my caching directory and updatedb will consume almost all  
the  
IO. I disabled my caching directory in updatedb.conf.

Thanks for the help.
