Search max_children erros in PHP Log – error.log
grep -r “server reached max_children setting” /var/log/*php*-fpm/error.log | cut -d’ ‘ -f5 | tr -d ‘]’ | sort | uniq -c | sort -nr
Plesk check PHP: pm.max_children for varioius websites
find /opt/plesk/php/ -type f -name “*.conf” -exec grep –color -Hni “pm.max_children =” {} \;
Make cron to modify PHP: max_children for php-fpm
ln -s /usr/local/sbin/mod_php_ini /etc/cron.hourly/
chmod +x /usr/local/sbin/mod_php_ini
cat /usr/local/sbin/mod_php_ini
MODIFIED=
[ -d /etc/php ] && find /etc/php/ -type f -name “*.conf” -exec grep -il “pm.max_children = 5$” {} \; | xargs sed -i “s/pm.max_children = 5$/pm.max_children = 50/g” 2>/dev/null && MODIFIED=true
[ -d /etc/php5 ] && find /etc/php5/ -type f -name “*.conf” -exec grep -il “pm.max_children = 5$” {} \; | xargs sed -i “s/pm.max_children = 5$/pm.max_children = 50/g” 2>/dev/null && MODIFIED=true
find /opt/plesk/php/ -type f -name “*.conf” -exec grep -il “pm.max_children = 5$” {} \; | xargs sed -i “s/pm.max_children = 5$/pm.max_children = 50/g” 2>/dev/null && MODIFIED=true
if [ ${MODIFIED} ] ; then
/etc/init.d/plesk-php71-fpm restart
/etc/init.d/plesk-php70-fpm restart
/etc/init.d/plesk-php56-fpm restart
fi