One of my PHP-FPM APC on Nginx installs was having some disk I/O from php-fpm children. I made a change to php.ini which reduced this by a factor of 5. 5x less disk I/O from php-fpm.
I checked out where the disk I/O was coming from with Top. Once in Top by pressing capital ‘O’ then ‘p’ let me see what was causing the minor disk I/O.
I have 1440 megabytes of Ram on this box. php-fpm max_children should be set according to the specs of your box. Just adding a large of max_children can at best use up your resources with little increase in performance and at worst bog down your server.
To fix it I changed my php.ini file. Previously I’d changed my kernel.shmmax to 256m, set my php-fpm max_children to 25. Then I had the following settings for APC (along with others) in php.ini:
apc.shm_segments = 1
apc.shm_size = 256
I changed these to:
apc.shm_segments = 25
apc.shm_size = 32
This reduced the disk I/O dramatically. That’s 25 shared memory segments each with 32 megabytes of memory.