Fixed: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting

Are you using apache server? Have you facing site down issue continuously? server reached MaxRequestWorkers setting error in your error log file?

Whenever you are using apache server with good Hardware configuration, Your site still goes down while got more traffic on site. There are so many possibilities are there for site down.

If you check your apache error log in /var/log/apache2/error.log, You will get exact error of site down. Some of that possible error, we are discussing 1 error which may possible.

Thu Apr 28 14:14:42.938075 2016] [mpm_prefork:error] [pid 19137] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting

How can you determine if Apache is hitting the max requests it is configured to allow? 

It is recommended to start by looking at the Apache error_log to check for any reports for the error. Apache can be quickly checked by running the following search in the command line:

Command: grep MaxRequestWorkers /etc/apache2/logs/error_log

If you see “server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting” error in your error.log file, You can fix it by the following way.

What are Apache’s current limits?

You can view Apache’s limits in both WHM and the command line.

Command-line: egrep 'MaxRequestWorkers|ServerLimit' /etc/apache2/conf/httpd.conf

egrep 'MaxRequestWorkers|ServerLimit' /etc/apache2/conf/httpd.conf
ServerLimit 256
MaxRequestWorkers 150

WHM: Home » Service Configuration » Apache Configuration » Global Configuration

MaxRequestWorkers can increase up to the value of the ServerLimit that is defined. By default, cPanel installation’s ServerLimit is set to 256. If you wish to increment MaxRequestWorkers beyond 256, update the ServerLimit to the new value you need as well.

What is the limit to which I should increase MaxRequestWorkers?

This question is best to be determined by the resources available on your server and your system administrator. Server optimisation is typically a task that is meant for a professional system administrator, as one would have the tools and knowledge to adjust this for you. If you have such a system administrator, reach out to them so they can look into this for you. The additional information below should also help with finding the limits of your server resources:

server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting

Solution: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting

Basically config got overwritten in: /etc/apache2/mods-available/mpm_prefork.conf

I put the new setting in that file and it seems Apache works correctly now.

Hopefully this helps someone else, don’t put your config straight in apache2.conf or httpd.conf. Make sure you change all loaded config files.

you should edit mpm_prefork.conf file


<IfModule mpm_prefork_module>
      StartServers                     10
      MinSpareServers               10
      MaxSpareServers              20
      ServerLimit                      2000
      MaxRequestWorkers         1500
      MaxConnectionsPerChild    10000
</IfModule>

You can increase your MaxRequestWorkers and ServerLimit as per your server configuration.

Note: Don’t forget to restart apache server after make changes in npm_prefork.conf file. use this command for restart apache server : sudo service apache2 restart

For more detail about this settings, you can refer it’s official documentation here.