Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I restarted my apache daemon today to reload the config file, but after this i began to see many php zombie processes on the system. The amount varies from 10 to 30 and they all take a little slice of CPU while they die. Where should I begin to debug this problem?

The modification I made was reducing Max Requests Per Child from 0 (massive memory leaks) to 1000. I think that the php processes are from a script that receives data from "dumb" devices, ie. they send a request with GET parameters and don't care about the result.

Some data:

uname -a

# uname -a
Linux <hostname> 2.6.32-71.29.1.el6.x86_64 #1 SMP Mon Jun 27 19:49:27 BST 2011 x86_64 x86_64 x86_64 GNU/Linux

ps -aux | grep php

# ps aux | grep php
user1     5709  1.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5717  1.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5721  1.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5722  2.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5723  2.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5724  2.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5725  2.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5729  2.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5731  2.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5737  2.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5760  2.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5778  1.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5793  2.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5798  1.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5800  1.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5833  2.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5850  2.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5870  3.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5875  2.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5876  2.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5877  2.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5886  0.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5926  0.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5939  0.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5941  0.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5961  0.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5962  0.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5973  0.0  0.0      0     0 ?        Z    12:15   0:00 [php] <defunct>
user1     5977  0.0  0.2 106836  8680 ?        R    12:15   0:00 /usr/bin/php /home/user1/public_html/<script>.php
root      5981  0.0  0.0 103228   836 pts/0    S+   12:15   0:00 grep php

free

# free -m
             total       used       free     shared    buffers     cached
Mem:          3831       3173        658          0        183       2502
-/+ buffers/cache:        487       3344
Swap:         4031          7       4024

uptime

# uptime
 12:18:10 up 105 days, 23:21,  1 user,  load average: 0.23, 0.20, 0.18

Anything else needed to help me debug this?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

It's not a problem. Zombies don't take up CPU, or memory, or anything other than process table slots. The zombies aren't hanging around for very long, you've said, so all that is happening is that the Apache master process is doing things other than waiting around for child processes to exit, so it's sometimes taking a little while before the terminated children get reaped.

share|improve this answer
    
Ok, thanks for providing some peace of mind. I Just started wondering about possible configuration errors because this stated happening right after reloading the config. Well, if it works, don't fix it, right? :) –  onik Apr 27 '12 at 9:39
    
It would have been happening previously whenever a child process was deemed "surplus to requirements", but because you weren't spawning and reaping child processes nearly as often you didn't notice it. –  womble Apr 27 '12 at 9:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.