Problems with Mod_fcgid.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have an issue with mod_fcgid spawning new php processes and after some time it looses control over php-cgi. I see many php-cgi processes running for long time. When I check parent process ID I see it is init owning them. They aren’t zombies though. It means httpd lost control over these processes. For time being number of process grows to the point my server goes out of memory. Stopping and starting httpd doesn’t kill them. Only way to stop php-cgi processes is to send the kill signal directly to the process.

Here are my wrapper settings:

#!/bin/sh                                                                                                                                     
# Do not change this file                                                                                                                     
PHPRC=/etc/                                                                                                                                   
export PHPRC                                                                                                                                  
export PHP_FCGI_MAX_REQUESTS=5000                                                                                                             
export PHP_FCGI_CHILDREN=0                                                                                                                    
exec /usr/bin/php-cgi


Here is our mod_fcgid config settings:
                                                                                                                      
       PHP_Fix_Pathinfo_Enable 1                                                                                                             
       FcgidProcessTableFile /tmp/fcgidshm_aux7                                                                                              
       FcgidIPCDir /tmp/.fcgidsock_aux7                                                                                                      
       FcgidMinProcessesPerClass 0                                                                                                           
       FcgidMaxProcessesPerClass 70                                                                                                          
       FcgidMaxProcesses 8000                                                                                                                
       FcgidMaxRequestLen 1073741824                                                                                                         
       FcgidMaxRequestInMem 20971520                                                                                                         
       FcgidIdleTimeout 30                                                                                                                   
       FcgidIdleScanInterval 60                                                                                                              
       FcgidBusyTimeout 300                                                                                                                  
       FcgidBusyScanInterval 120                                                                                                             
       FcgidErrorScanInterval 20                                                                                                             
       FcgidZombieScanInterval 3                                                                                                             
       FcgidProcessLifeTime 60                                                                                                               
       FcgidIOTimeout 300                                                                                                                    


I see this problem on mod_fcgid 2.3.6 with Apache 2.2.3 distributed by Cloudlinux repository for CentoOS 5 as well as for most recent version of mod_fcgid 2.3.7 with Apache httpd 2.2.15 for Cent OS 6.2.

Only solution I have so far is script like one shown here: http://www.sonassi.com/knowledge-base/abandoned-php-fcgi-process-clean-up/

Screenshot showing example of a php-cgi processes that have lost parent control.
http://quick-markup.com/p/500f1d0461f16

**I have cronjob doing httpd graceful restart each hour. The issue here may be related to that cronjob. Although I haven’t observed it is caused by graceful restart. Usually it takes couple of days when I see php-cgi processes being old.

Is there anything else I should check in my system to eliminate this issue?

--

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux