Applicable to:
- Plesk for Linux
Symptoms
-
Webmail or Websites are loading very slow or loading continuously and eventually fail with a 50x error in a web-browser: 500 Internal Server, 502 Bad Gateway, 503 Service Temporarily Unavailable, 504 Gateway Time-out.
-
The following message appears on the domain's Logs page (Plesk > Domains > example.com > Logs) or in the domain's error logfile
/var/www/vhosts/system/example.com/logs/error_log
directly on the server:CONFIG_TEXT: mod_fcgid: can't apply process slot for /var/www/cgi-bin/cgi_wrapper/cgi_wrapper
-
In some cases, the following error message may appear in domain's
proxy_error_log
file/var/www/vhosts/system/example.com/logs/proxy_error_log
:CONFIG_TEXT: [log_config:warn] [pid 30019] (32)Broken pipe: [client 203.0.113.2:51022] AH00646: Error writing to |/opt/psa/admin/sbin/pipelog 7081, referer: http://www.example.com/
Cause
The Apache FcgidMaxProcesses
, or FcgidMaxProcessesPerClass
limit has been reached.
In rare cases, the issue might appear when a client closed the connection before waiting for the server to respond.
Resolution
If the client closed the connection before receiving a server's response, the issue is on the client side.
To increase FcgidMaxProcesses
and FcgidMaxProcessesPerClass
:
-
Connect to the Plesk server via SSH.
-
Increase the value of
FcgidMaxProcesses
andFcgidMaxProcessesPerClass
:2.1. Open the
fcgid.conf
file in any text editor. In this example we are using the vi editor:-
on CentOS/RHEL-based distributions
# vi /etc/httpd/conf.d/fcgid.conf
-
on Debian/Ubuntu-based distributions
# vi /etc/apache2/mods-enabled/fcgid.conf
2.2. Navigate to the directive
FcgidMaxProcesses
and increase its value. General recommendations: RAM 8GB - about 150, RAM 16GB - 300.2.3. Navigate to the directive
FcgidMaxProcessesPerClass
and increase its value to 10, or 15.2.4. Save the changes and close the file.
-
-
Check if there are other files in the Apache configuration directory that can override parameters in
fcgid.conf
. If files other than fcgid.conf are found, increase theFcgidMaxProcesses
andFcgidMaxProcessesPerClass
limit in these files too.-
on CentOS/RHEL-based distributions:
# grep -irE 'FcgidMaxProcesses|FcgidMaxProcessesPerClass' /etc/httpd/conf.d/
-
on Debian/Ubuntu-based distributions:
# grep -irE 'FcgidMaxProcesses|FcgidMaxProcessesPerClass' /etc/apache2/
-
-
Restart Apache to apply the changes:
-
on CentOS/RHEL-based distributions:
# service httpd restart
-
on Debian/Ubuntu-based distributions:
# service apache2 restart
-
-
Check websites' status.
If the solution above did not help, switch faulty domains to nginx with PHP-FPM:
5.1. In Plesk go to at Domains > example.com > PHP Settings and run PHP as FPM application served by nginx.
5.2. Go to domain's Apache & nginx Settings:
- Proxy mode
- Smart static files processing
- Serve static files directly by nginx
Comments
2 comments
did you tested that solution...??
after the restart of the apache the value changes back to the original value
@TechTown GmbH
Hello! I have just tested the solution on my Plesk Onyx (CentOS 7)
Please describe a scenario when this setting was changed to original value.
Please sign in to leave a comment.