Why does Apache keep going down in the Plesk server?

Why does Apache keep going down in the Plesk server?

You would have received an error by saying

“server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting”

At this time, note clearly - The Apache may get slow in the Plesk server.

CentOS: RHEL-based distributions:
Code:
/var/log/httpd/error_log
Debian: Ubunty-based distributions:
Code:
/var/log/apache2/error.log
This error is due to the limitation fixed by the admin where the maximum number of workers alone is allowed. If the limit gets crossed then you will get the error, as well as the Apache, gets slow.

By adjusting the settings of MaxRequestWorkers, we can sort out this problem.

Execute the below mentioned command:

# MaxRequestWorkers = (Total RAM - Memory used for Linux, DB, etc.) / process size

Event of MPM: 16 is the default limit of the server. Based on the requirement, it is easy to adjust the number. Using the below-mentioned formulae, we can increase the MaxRequestWorkers limitation:

Code:
Value of ServerLimit x 25 = value of MaxRequestWorkers
The value of ServerLimit is 40 then calculate accordingly:
40 x 25 = 2080
Prefork MPM: 256 is the default value of MaxRequestWorkers.

Distribution of RHEL/CentOS:

Step 1: Using the command, find the MPM:


Code:
# httpd -V | grep MPM
Step 2: Using the mentioned path, open the file /etc/httpd/conf.modules.d/01-cgi.conf and start modifying the values.

Prefork of MPM:

Code:
LoadModule cgi_module modules/mod_cgi.so
MaxRequestWorkers 600
ServerLimit 600
Event of MPM:

Code:
LoadModule cgid_module modules/mod_cgid.so
MaxRequestWorkers 600
ServerLimit 16
Once done, kindly restart the Apache with the command:

Code:
# service httpd restart
Distribution of Ubuntu/Debian users:

Step 1:
Start finding the MPM using the below-mentioned command:

Code:
# apache2ctl -V | grep MPM
Step 2: Prefork of MPM:

Open the file by using the path /etc/apache2/mods-enabled/mpm_prefork.conf and start increasing the values.

Code:
MaxRequestWorkers 500
ServerLimit 500
Event of MPM:

Open the file /etc/apache2/mods-enabled/mpm_event.conf and increase the value.

Code:
MaxRequestWorkers 600
ServerLimit 16
Step 3: To apply all the changes kindly restart the Apache:

Code:
# service apache2 restart
That's it! It is easy to update the changes in Apache and increase the count of MaxRequestWorker.
Author
kumkumsharma
Views
1,822
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top