Admin-Ahead Community

Linux => Control Panels => Plesk => Topic started by: sibij on May 26, 2018, 09:21:55 pm

Title: Sites are very slow. Apache shows: server reached MaxClients setting on Plesk fo
Post by: sibij on May 26, 2018, 09:21:55 pm
Symptoms >:(

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


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

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: [Select]
    <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>

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: [Select]
# grep -iRl "MaxClients" /etc/
If there is no such option at all, add it manually to files listed above.