What to do in case of Apache error server reached MaxRequestWorkers setting?
If you see a message in your Apache error log which is like, ‘server reached MaxRequestWorkers setting’, it does not indicate that there is anything incorrect with Apache or your Apache MaxRequestWorkers setting. You should not be making any changes to Apache.
However, it means that one of your apps has been having slow PHP scripts or is receiving such a large number of requests that your PHP scripts are unable to answer requests as quickly as they are coming in.
The reason behind this error to happen?
For each app, PHP can simultaneously perform a limited number of requests. If a PHP script performs very slowly, a small amount of traffic can even be causing this limit to be reached.
When this limit is reached and all of an app’s PHP processes are busy executing requests, every additional request that comes into your server is queued by Apache until PHP completes an existing request and is available for another, ServerPilot reports.
While the number of queued requests waiting for PHP becomes too large, you see this ‘server reached MaxRequestWorkers’ setting” error message.
Identifying a Slow PHP Script
In this case, you should look at your app’s PHP slow log located at: /srv/users/serverpilot/log/APPNAME/APPNAME_phpX.Y.slow.log
where phpX.Y is the version of PHP your app is using, for example, php5.6.
Identifying a Large Amount of Traffic to a PHP Script
If you do not see any slow requests, then you should check your app’s PHP access log at:
/srv/users/serverpilot/log/APPNAME/APPNAME_phpX.Y.access.log
to see if you are receiving a large number of requests that you do not expect.