Fix "server reached MaxRequestWorkers" Apache error
The error âserver reached MaxRequestWorkersâ in the Apache service logs does not mean the Apache MaxRequestWorkers setting needs to be changed.
The âserver reached MaxRequestWorkers settingâ message means one of the apps on the server is receiving requests faster than the requests can be answered based on the speed of the appâs code and the serverâs available CPU and memory.
Cause of âserver reached MaxRequestWorkersâ
The number of PHP requests an app can execute concurrently
is determined by the appâs PHP-FPM max_children setting.
When this limit is reached
and all of an appâs PHP processes are busy executing requests,
each additional request that comes in to the server is queued by Apache
until the app completes one of the PHP requests that is already executing.
When the number of requests queued in Apache becomes too large,
Apache logs the message âserver reached MaxRequestWorkers settingâ.
To identify which app is causing the problem,
SSH into the server as root and run the following command
to search the
PHP-FPM service logs
to look for occurrences of apps reaching their PHP-FPM max_children limit.
sudo grep -F "max_children" /var/log/php*-fpm-sp.logFix âserver reached MaxRequestWorkersâ
To fix the âserver reached MaxRequestWorkersâ error, increase the appâs PHP max_children setting.
Fix âScoreboard is full, not at MaxRequestWorkersâ
Unlike the log message âserver reached MaxRequestWorkers settingâ, the log message âScoreboard is full, not at MaxRequestWorkersâ indicates a bug in Apache that was fixed in a previous version of Apache. However, there have been a very small number of reports of Apache encountering this same bug after the bug was fixed.
The bug was triggered by the same conditions that triggered
the âserver reached MaxRequestWorkersâ error.
Increasing the
PHP max_children setting
for any apps that were hitting their PHP-FPM max_children limit
should resolve the problem.
If you encounter the error âScoreboard is full, not at MaxRequestWorkersâ, restart Apache using the following command.
sudo service apache-sp restart