Introduction
Tuning Apache's MaxRequestWorkers
setting is essential to mitigate the risk of resource usage problems that could lead to a crash and ensure that your server can use its available resources. This article provides basic guidance for tuning MaxRequestWorkers
.
Please note that cPanel support cannot provide specific configuration guidance because the required configuration will change based on several variables.
Setting the MaxRequestWorkers
configuration too high could allow Apache to use too many resources during periods of high traffic which may result in services crashing if server resources are exhausted. Ideally, the setting would be set high enough that the server uses a large portion of the available resources, but still has enough free resources to maintain stability.
Procedure
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Run the following command to view how much memory each Apache process is currently using in MB.
ps -ylC httpd --sort:rss | awk 'NR!=1 {$8 / 1024}'
- Estimate the expected average memory usage for an Apache process based on the above output.
- Run the following command to find the available memory in MB.
free -m | awk 'NR==2 {print $7}'
- Divide the available memory by the expected average memory usage for an Apache process to determine the
MaxRequestWorkers
value. - Log in to WHM as the root user.
- Navigate to "Home / Service Configuration / Apache Configuration / Global Configuration."
- Scroll down to the "Server Limit" option.
- Enter a value higher than the
MaxRequestWorkers
value in the "Server Limit" textbox. - Enter the
MaxRequestWorkers
value in the "Max Request Worker" textbox. - Click the "Save" button.
- Click the "Rebuild Configuration and Restart Apache" button.
Additional resources
Apache's Documentation: Hardware and Operating System Issues
Comments
0 comments
Article is closed for comments.