There's a ton of info and settings floating around out there about mod_fcgid settings, and tons of frustration's with getting it too work efficiently.
I speak from first hand experience btw... I've invented several new cuss words while dealing with mod_fcgid and fastcgi over the last few years.
Hopefully this pain can be avoided, so let's post some settings and figure out what works best for our setups.
As of now things are working pretty good on our server:
Here's my mod_fcgid v2.36 settings, in WHM I add these to: Main >> Service Configuration >> Apache Configuration >> Include Editor >> Post VirtualHost Include (so they are retained when apache is rebuilt)
These settings are modified from the defaults a bit for this particular server and any clients sites/apps. Mostly tweaks that needed implemented from various software updates, issues and errors.
Note: FcgidPassHeader HTTP_AUTHORIZATION - This setting might not be needed for your setup.
The mod_fcgid default settings can be found on apache.org.
In /usr/local/apache/conf/php.conf file, I have these settings (I'm also experimenting with adding these to Pre-Main Global in WHM so settings are retained on any updates):
The majority of these settings have been working pretty well for a few weeks now, the last adds were the FcgidSpawn settings. The Apache docs, cPanel forums - staff and user feedback was where the majority of these settings were found. It's an ongoing process though like anything, looking forward to some feedback and ongoing discussions.
I speak from first hand experience btw... I've invented several new cuss words while dealing with mod_fcgid and fastcgi over the last few years.
Hopefully this pain can be avoided, so let's post some settings and figure out what works best for our setups.
As of now things are working pretty good on our server:
Code:
Server Version: Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/0.9.8e-fips-rhel5 [B]mod_fcgid/2.3.6[/B] mod_bwlimited/1.4 mod_perl/2.0.4 Perl/v5.8.8
Running PHP 5.3.6 on a dedicated box with 8G ram, eAccelerator 0.9.6.1
Code:
# mod_fcgid settings v2.36 post_virtualhost_global.conf
<IfModule mod_fcgid.c>
FcgidBusyScanInterval 90
FcgidBusyTimeout 600
FcgidErrorScanInterval 3
FcgidFixPathinfo 1
FcgidIdleScanInterval 70
FcgidIdleTimeout 360
FcgidIOTimeout 1000
FcgidMaxProcesses 1000
FcgidMaxProcessesPerClass 100
FcgidMaxRequestInMem 268435456
FcgidMaxRequestLen 1073741824
FcgidMaxRequestsPerProcess 0
FcgidMinProcessesPerClass 3
FcgidOutputBufferSize 1048576
FcgidPassHeader HTTP_AUTHORIZATION
FcgidProcessLifeTime 3600
FcgidSpawnScore 1
FcgidSpawnScoreUpLimit 10
FcgidTerminationScore 2
FcgidTimeScore 2
FcgidZombieScanInterval 3
</IfModule>
Note: FcgidPassHeader HTTP_AUTHORIZATION - This setting might not be needed for your setup.
The mod_fcgid default settings can be found on apache.org.
In /usr/local/apache/conf/php.conf file, I have these settings (I'm also experimenting with adding these to Pre-Main Global in WHM so settings are retained on any updates):
Code:
# Fastcgi configuration for PHP5 - pre_main_global.conf
LoadModule fcgid_module modules/mod_fcgid.so
FcgidMaxRequestsPerProcess 10000
FcgidConnectTimeout 60
FcgidIOTimeout 1000
AddHandler fcgid-script .php5 .php4 .php .php3 .php2 .phtml
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php5
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php4
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php3
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php2
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .phtml
# PHP configuration pre_main_global.conf