Apache MPM Module Configuration

Operating System & Version
CentOS 7.8
cPanel & WHM Version
90.0.5

syedabdulbaqi

Member
Feb 29, 2020
6
2
3
India
cPanel Access Level
Root Administrator
I am trying to optimize the performance of webserver (apache). The current (default) MPM module on the server is Worker.

Hardware Specification:
CPU: 2 Cores
RAM: 4 GB


The default configuration under Home > Service Configuration > Apache Configuration > Global Configuration is:

Code:
Start Servers: 5
Minimum Spare Servers: 5
Maximum Spare Servers: 10
Server Limit: 256
Max Request Workers: 150
Max Connections Per Child: 10000
Keep-Alive: ON
Keep-Alive Timeout: 5
Max Keep-Alive Requests: 100
Timeout: 300
Referring to Apache's official documentation, these values are defaults for Prefork, not Worker. So obviously these parameters need to be tuned for optimal performance.

I tried the Apache2Buddy script for getting some suggestions, but the script doesn't provide ServerLimit value for the Worker module. So, I changed it to the default value (16) according to the Apache docs. There is no configuration for ThreadsPerChild, so I am assuming the default value (25).

So based on the above values I calculated the Max Request Workers = ServerLimit (16) * ThreadsPerChild (25) = 400

So the new configuration looks like:

Code:
Start Servers: 5
Minimum Spare Servers: 5
Maximum Spare Servers: 10
Server Limit: 16
Max Request Workers: 400
Max Connections Per Child: 10000
Keep-Alive: ON
Keep-Alive Timeout: 5
Max Keep-Alive Requests: 100
Timeout: 300
The average memory consumption of httpd process is 0.6%. I want to know if this configuration is correct for optimal performance, or should I increase ServerLimit even more? Also, is there any scope of improvement on other parameters specifically Keep-Alive Timeout and Max Keep-Alive Requests?

Thanks.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,297
1,251
313
Houston
While there may be some that can provide advice like this for you here, I would always advise you go with the advice of a qualified system administrator. If you don't have one you might find one here: System Administration Services

Thanks!