• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Error reading data from FastCGI server

Marco G

New Pleskian
Hi to everybody,

it has been 2 days I try to find a solution about this problem in all forums but i can't still find a solution.
First of all I have to tell this is a server has 64GB RAM and 12 cores AMD with Plesk 12 and has been running for more than one year without problem (and without any reboot). It is a server that has more than 40.000 visitors per day and process many files. It has been very stable until yesterday that we had to reboot.

The day before the server suddenly started to give this errors too:
Code:
mod_fcgid: can't apply process slot for /var/www/cgi-bin/cgi_wrapper/cgi_wrapper
and the website was down.

So we restarted the server (took very long time to restart) and disabled cloudflare cdn (so static content will be served directly from server). After restart website do not worked. And I found a solution of someone who had the same problem and I disabled nginx:
Code:
/usr/local/psa/admin/sbin/nginxmng --disable
/usr/local/psa/admin/sbin/httpdmng --reconfigure-all
and re-enabled and it worked, the website was running. But nginx was giving a lot of errors of read (24: Too many open files).

So following instructions from a website we edit /etc/nginx/nginx.conf and we added
worker_rlimit_nofile 30000; and 4 workers. At the same time we activated cloudflare cdn. The problem seemed solved but we had many random errors on error_log from log registers of a domain in Plesk:

Code:
[Tue Oct 14 00:47:59 2015] [warn] [client xxx.xxx.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: http://www.domain.com/page
[Tue Oct 14 00:47:59 2015] [error] [client xxx.xxx.xxx.xxx] Premature end of script headers: index.php, referer: http://www.domain.com/page

Before reboot we also had sometimes this errors but there were like 20 per day, now are like 300 per day.

After that I reset the default nginx.conf and the website was still stable, so maybe was the cdn that was inactive that caused read (24: Too many open files) but is strange because I think static files are served directly thru apache.

Obviously I modify /etc/httpd/conf.d/fcgid.conf to see if something changes but it didn't worked, or maybe I mess up the last config of fcgid and the current is the one that causes the problems... this is the current fcgid.conf:
Code:
<IfModule mod_fcgid.c>

<IfModule !mod_fastcgi.c>
    AddHandler fcgid-script fcg fcgi fpl
</IfModule>

  FcgidIPCDir /var/run/mod_fcgid/sock
  FcgidProcessTableFile /var/run/mod_fcgid/fcgid_shm

  FcgidIdleTimeout 300
  FcgidProcessLifeTime 3600
  FcgidMaxProcesses 1000
  FcgidMaxProcessesPerClass 16
  FcgidMinProcessesPerClass 5
  FcgidConnectTimeout 300
  FcgidIOTimeout 1800
  FcgidInitialEnv RAILS_ENV production
  FcgidIdleScanInterval 10
  FcgidMaxRequestLen 1073741824
  FcgidBusyTimeout 1800
  FcgidIdleScanInterval 480
</IfModule>
More info: the /var/log/httpd/suexec_log shows many lines like:
Code:
[2015-10-15 10:48:57]: uid: (10001/user) gid: (503/503) cmd: cgi_wrapper

The website is running now, but I can't reproduce the error as user so I installed a code to error_doc/internal_server_error.html and error_doc/maintenance.html to track users with this erros, and I get some, but less than the errors displayed in the error_log. I don't know if mod_fcgid: error reading data from FastCGI server error happens users can see this error page or the page it is empty.

Another thing to notice is the CPU consumption of web apache has changed since reboot:

303068e4_o.jpeg


All of this is the information I have until now.
Thank you very much for your support
 
Last edited:
Back
Top