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

Apache.conf

To start, open the Apache configuration file and locate the directives section:

On a DirectAdmin based server it will be located in: /etc/httpd/conf/extra/httpd-mpm.conf
On a cPanel server, it will be located in /usr/local/apache/conf/
On a Plesk server, it will be in /etc/httpd/conf/

 

  • 0 Users Found This Useful
Was this answer helpful?