Linux > Plesk

Sites are very slow. Apache shows: server reached MaxClients setting on Plesk fo

(1/1)

sibij:
Symptoms >:(

Loading the website takes too much time. The following error appears in the /var/log/httpd/error_log :



--- Code: ---error] server reached MaxClients setting, consider raising the MaxClients setting
[warn] mod_fcgid: process 2968 graceful kill fail, sending SIGKILL
Cause
--- End code ---

The connections limit defined by MaxClients is reached.
Resolution

  1.  Connect to the server via SSH.
  2. By default, Apache in Plesk is not configured for high-loaded sites. It is recommended to tune Apache performance as it described here: http://httpd.apache.org/docs/2.2/misc/perf-tuning.html  or https://httpd.apache.org/docs/2.4/misc/perf-tuning.html

    3. To resolve the issue with the MaxClients limit, adjust the /etc/httpd/conf/httpd.conf(/etc/apache2/conf/apache2.conf for Debian/Ubuntu) file on SystemV OSes (CentOS 6 or lower), increasing the MaxClients value (e.g., to 100):

--- Code: ---    <IfModule prefork.c>
    StartServers 5
    MinSpareServers 10
    MaxSpareServers 25
    MaxClients 100
    MaxRequestsPerChild 10000
    </IfModule>

    <IfModule worker.c>
    StartServers 5
    MinSpareThreads 10
    MaxSpareThreads 25
    ThreadsPerChild 50
    MaxClients 100
    MaxRequestsPerChild 10000
    </IfModule>
--- End code ---

Note: For CentOS 7, file /etc/httpd/conf.d/mpm_prefork.conf should be edited instead of <IfModule prefork.c> section. If the error persists, consider increasing MaxClients limit again until the issue is fixed.
For Debian/Ubuntu, use the following files /etc/apache2/mods-available/mpm_prefork.conf and /etc/apache2/mods-available/mpm_worker.conf

If the error is still shown, check all files where MaxClients directive defined. It can be done with the following command:


--- Code: ---# grep -iRl "MaxClients" /etc/
--- End code ---

If there is no such option at all, add it manually to files listed above.


Navigation

[0] Message Index

Go to full version