- Plesk for Linux
Websites that have PHP handler set as FPM application served by Apache or FPM application served by nginx at Domains > example.com > PHP Settings load slowly or are not accessible (permanently or periodically) with a 50x error in a web-browser:
PLESK_INFO: 500 Internal Server Error
PLESK_INFO: 502 Bad Gateway
PLESK_INFO: 503 Service Temporarily Unavailable
PLESK_INFO: 504 Gateway Time-out
Error messages as below (in bold) appear in the PHP-FPM error logfile
# grep "server reached max_children setting (X), consider raising it" /var/log/*php*-fpm/error.log* | wc -l
# grep "unable to read what child say: Bad file descriptor (9)" /var/log/*php*-fpm/error.log* | wc -l
Additionally, on Debian/Ubuntu-based distributions run:
# grep "server reached max_children setting" /var/log/*php*-fpm.log | wc -lon Red Hat-based distributions run:
# grep "server reached max_children setting" /var/log/*php*-fpm/error.log* | wc -l
In some cases, the error message can be as follows:
CONFIG_TEXT: [pool example.com] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 4 idle, and 152 total children
Server performance may decrease due to php-fpm processes that use up to 100% of CPU.
If nginx is enabled on the server, one of the following error messages may appear in domain's error logfile
CONFIG_TEXT: [error] 11456#0: *118348 connect() to unix:///var/www/vhosts/system/example.com/php-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 203.0.113.2, server: example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:///var/www/vhosts/system/example.com/php-fpm.sock:", host: "example.com"
CONFIG_TEXT: [error] 20058#0: *4725139 upstream prematurely closed connection while reading response header from upstream, client: 203.0.113.2, server: example.com, request: "POST /path/to/some/file HTTP/2.0", upstream:
Child processes of PHP-FPM master process constantly reaches its limit.
Connect to the Plesk server via SSH.
Find out what domains are affected using the command below:
# grep "server reached max_children" /var/log/*php*-fpm/error.log* | cut -d' ' -f5 | tr -d ']' | sort | uniq -c | sort -nr
Additionally, on Debian/Ubuntu-based distributions run the following command to scan the log of PHP-FPM by OS vendor:
# grep "server reached max_children setting" /var/log/*php*-fpm.log | cut -d' ' -f5 | tr -d ']' | sort | uniq -c | sort -nr
pm.max_childrenlimit for them using the instructions below. Note that server performance can be affected if
pm.max_childrenis too big.
Plesk Onyx 17.5 and newer releases
Plesk 12.5 and previous releases