I have the following Nginx php-fpm5.6 settings
pm = dynamic pm.max_children = 150 min_spare_servers) / 2 pm.start_servers = 10 pm.min_spare_servers = 1 pm.max_spare_servers = 25
Each child process is around 91MB and I have 16GB of of ram.
When the max number of children is reached I start to get errors in the log along the lines of:
- connect() to unix:/run/php/php5.6-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream
- failed (104: Connection reset by peer) while reading response header from upstream
Ultimately I end up having to restart php5.6-fpm to get everything working again.
I don't understand why there are so many open child processes that don't appear to be used. I've attached a screenshot of htop which looks like there are a lot of php-fpm not consuming any ram or cpu time. (https://drive.google.com/file/d/11kEjgcMDyc4EDbJU7DE_y87V6RRJ4ekN/view?usp=sharing)
Any ideas on how to solve / diagnose the issue?