Oops!! Are you seeing server reached the MaxRequestWorkers setting error? We can help you with it.

The webserver reaches the MaxRequestWorkers setting when the number of processes shoots up due to high traffic.

At Bobcares, we often get requests from our customers regarding the Apache errors as part of our Server Management Services.

Today, we’ll see how our Support Engineers resolve errors with Apache process limits for our customers.


How does Apache work?

Optimizing Apache brings in the best loading time for any website.  Let’s now check more on the major points in the working of Apache.

Apache is modular. This means we can add to or remove features from it easily. It is the Multi-Processing Modules aka MPM that provide this modularity.

MPMs are responsible for binding to network ports on the machine, accepting and handling the requests, etc. The choice of MPM and it’s setting affects the Apache functionality.

There are a number of MPMs like MPM Worker, MPM Event, MPM Prefork, etc and have many MPM values. One such MPM value is MaxRequestWorkers.


What exactly is the MaxRequestWorkers parameter?

This is the limit to the number of concurrent requests to be served by Apache. Any number of connection attempts above the MaxRequestWorkers limit will be queued.

Website requests always spike up during busy hours. This, in turn, generate too many Apache processes.

If this MaxRequestWorkers value is set too low, there will be long delays in loading the pages during peak hours. And, if it is set to too high, Apache exceeds the hardware limitations and may lead to a server crash.

In MPM prefork the default MaxRequestWorkers value is 256.

While increasing MaxRequestWorkers, we need to increase the value of ServerLimit also. We always take care of these scenarios while dealing with MaxRequestWorkers.

Today, let’s see how our Engineers help our customers in tweaking Apache configuration.


How we handle Server Reached MaxRequestWorkers Setting error

Recently, one of our customers using IPTV approached us saying that his portal was not loading properly.

So, our Engineers checked in detail and found that the load was high on the server at that time. Hence, we dug deeper into what is causing such a high load.

Lastly, we figured out that the Apache was causing such a high load. Next, we checked the number of Apache process at that point using the command below:

ps aux | grep apache | wc -l

And it gave an output of 460.

Further, we checked the logs and found an error like:

Fri Jan 03 15:02:32.958854 2020] [mpm_prefork:error] [pid 1001] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting

It clearly stated that the Apache server was hitting the MaxRequestWorkers limit. Hence, we checked the value of MaxRequestWorkers in /etc/apache2/mods-enabled/mpm_prefork.conf and it was too low to handle such high requests.

So, we increased the value. For changing the settings, we followed the steps below:

Firstly, we opened  /etc/apache2/mods-enabled/mpm_prefork.conf

vi /etc/apache2/mods-enabled/mpm_prefork.conf

Then, we searched for MaxRequestWorkers and Serverlimit.

Next, we changed the values to 500 as shown:

Server Reached Max Request Workers Setting

Finally, we restarted the service using the command below:

service apache2 restart

This reduced the server load and successfully accessed the portal.

Note: The load on the server may occur due to various reasons and the server reaching the MaxRequestWorkers setting is one of such reasons. Again, increasing and decreasing the value of MaxRequestWorkers depend on the processor capacity too.

Our, Support Engineers consider all the physical resources on the server before tweaking the configuration of Apache. This ensures smooth working of the websites.


[Having trouble with Apache MaxRequestWorkers? We’ll fix it for you.]



In short, the fix for Server Reached MaxRequestWorkers Setting error involves tweaking the Apache parameters to handle a large number of visitors. Today, we so how our Support Engineers help customers in handling such situations.


Source link


Write A Comment