php processes owned by ppid 1 after X amount of time

Posted by Kristopher Ives on Server Fault See other posts from Server Fault or by Kristopher Ives
Published on 2012-03-28T22:10:10Z Indexed on 2012/03/28 23:33 UTC
Read the original article Hit count: 365

Filed under:
|
|
|

I have a CentOS server running WHM that uses FastCGI (mod_fcgid) running PHP 5.2.17 on Apache 2.0 with SuExec. When I start Apache it begins fine and serving requests. If I run ps on the terminal as root I see the php processes and they are owned by their httpd parent processes.

After X amount of time - different from time to time, not much longer than a few hours typically - the server will begin spawning PHP jobs owned by the init process ID (1)

Example of good listing:

12918 18254 /usr/bin/php
12918 18257 /usr/bin/php
12918 18293 /usr/bin/php
12918 18545 /usr/bin/php
12918 18546 /usr/bin/php
12918 19016 /usr/bin/php
12918 19948 /usr/bin/php

Then later something like:

1  6800 /usr/bin/php 
1  6801 /usr/bin/php 
1  7036 /usr/bin/php 
1  8788 /usr/bin/php 
1 10488 /usr/bin/php  
1 10571 /usr/bin/php  
1 10572 /usr/bin/php 

The php processes running owned by (1) never get cleaned up. Why would these processes be running? We don't use setsid or anything beyond basic PHP in the code this server is running.

Cheers & Thanks

© Server Fault or respective owner

Related posts about linux

Related posts about apache2