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
the parent processes of these processes died but they themselves did not terminate so they have become orphans and thus adopted by process 1, i.e., init. the software usually has problems when this happens a lot, and you may want to consider upgrade to a newer version.