2

My Wordpress blog site has generally 200 users per minute but under 1000 users per minute load my site gets very slow and this warning appears in my error_log.

[Sun Aug 17 16:44:41 2014] [warn] [client **.***.**.***] mod_fcgid: can't apply process slot for /var/www/cgi-bin/cgi_wrapper/cgi_wrapper

Sometimes these two also accompany the warn:

[Sun Aug 17 16:44:41 2014] [warn] [client ***.***.***.**] mod_fcgid: read data timeout in 45 seconds
[Sun Aug 17 16:44:41 2014] [error] [client ***.***.**.**] Premature end of script headers: index.php

I checked server status and CPU, Memory and Load levels are below 30%.

Server Information:

CPU     GenuineIntel, Intel(R) Xeon(R)CPU L5630 @ 2.13GHz
Version Parallels Plesk Panel v11.5.30_build115130819.13 os_CentOS 5
OS      CentOS 5.5 (Final)
Memory  5.89 GB

Prefork.c:

<IfModule prefork.c>
StartServers 1
MinSpareServers 1
MaxSpareServers 3
ServerLimit 50
MaxClients 50
MaxRequestsPerChild  4000
</IfModule>

Fcgid.conf

FcgidIdleTimeout 40
FcgidProcessLifeTime 30
FcgidMaxProcesses 20
FcgidMaxProcessesPerClass 8
FcgidMinProcessesPerClass 0
FcgidConnectTimeout 30
FcgidIOTimeout 45
FcgidInitialEnv RAILS_ENV production
FcgidIdleScanInterval 10    

What can be the reason of this warning and how can I fix it?

NecNecco
  • 211
  • 2
  • 8

1 Answers1

2

Have you seen http://www.cloudlinux.com/blog/clnews/perfecting-fastcgi-settings-for-shared-hosting.php?

FcgidMaxProcesses -- this is the total number of processes FCGID will start, for all users. That is what will prevent OOM issues. The more RAM you have, the higher you can set the value. If you set this value too low, you will get 500 errors, as FCGID will not be able to create new processes to serve requests. This value also depends on the size of PHP processes (which in turn depends on extensions that you have enabled for PHP) as the larger the process the faster you will him OOM. You can try playing with following numbers depending on your RAM: 8GB -- about 150, 16GB – 300 Also, make sure you monitor apache error logs. If you see "can't apply process slot for error" -- it means you are hitting FcgidMaxProcesses

Try to increase FcgidMaxProcesses to 150