I run a CentOS 5.6 (64bit) machine that has Nginx (latest version) running, with php-fpm (latest version). Things run very well, but since about 2 weeks I noticed in my Munin graphs that about every 2 hours the 'cache' usages drops. Before it used be a steady fully graph, that didn't seem to reset every so often.
PHP-FPM settings:
pm.max_children = 300
daemonize = yes
pm = static
listen = /tmp/fpm.sock
pm.max_requests = 1000
I have checked the php-fpm.log, and about once per 5 seconds a child process is killed, and restarted. But this is all the time, so this does not explain the sudden drops.
I only run Nginx, PHP (via fpm), Munin and vsftpd on this machine. No crons run at exactly the time of the drops.
My question: What could be causing these drops in cache usage?
I think some large file that's part of your webserver is responsible. I'm guessing a log that is rotated or compressed as a function of general housekeeping. Below are some experiments showing that Linux dumps that part of the cache when a file is removed, including by means of a utility like gzip.
But that's probably not what's happening. What if a file were deleted? Would it still be referenced?
And, if we reload it then compress the file:
I'm not sure about CentOS 5.6, but for my Linux 2.6.32-5-amd64 adding this line in
/etc/sysctl.conf
resolves this problem.
Solved it by putting
vm.zone_reclaim_mode = 0