Even how high I set the pm.start_servers, or pm.min/max_spare_servers, I always get this error when PHP-FPM reach the limit:
WARNING: [pool web8] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 31 idle, and 62 total children
I noticed that when I reload php-fpm most often, I never seen this kind of error. This is also supported by this blog.
My question is if it is okay to reload php-fpm every 9 minutes or whatever interval you set.
Update:
Here's my current configuration of my two website with highest traffic (each website is running a separate pool):
pm.max_children = 256
pm.start_servers = 50
pm.min_spare_servers = 40
pm.max_spare_servers = 192
pm.max_requests = 500
And I also execute this command when the memory used reaches 90%:
/sbin/sysctl -w vm.drop_caches=3
After the command is executed, the memory used is back to 30%. I don't know if this is another bad idea. I do this because if not, the memory is rising up to 100% and it uses swap.
I'm running the following specs:
Single Processors: WHT Xeon E3-1270 v2
32 GB RAM