Skip to main content

httpd causing high CPU load in CentOS / DirectAdmin

If you did TOP in ssh, and noticed httpd process has a high cpu load, and has been running for a long time (e.g. over 5 minutes) then you might try lowering your MaxRequestsPerChild.

vi /etc/httpd/conf/extra/httpd-mpm.conf

Now change your MaxRequestsPerChild from 1000 to 20...

<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers      10
    MaxSpareServers      20
    ServerLimit         812
    MaxClients          812
    MaxRequestsPerChild   20
</IfModule>
service httpd restart

now try top again, and you should see your cpu load for httpd go down dramatically... after you may want to increase your MaxRequestsPerChild while keeping an eye on TOP, to figure out what the sweet spot is for your server and traffic/load situation.

Post new comment

The content of this field is kept private and will not be shown publicly.