Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is httpd <defunct>? [closed]

32537 apache    16   0 87424  15m 7324 S  2.3  0.3   0:00.52 httpd              
 3302 mysql     15   0  156m  41m 4756 S  1.3  0.7  10:50.91 mysqld             
  489 apache    16   0 87016  14m 6692 S  0.7  0.2   0:00.27 httpd              
  990 apache    15   0     0    0    0 Z  0.7  0.0   0:00.12 httpd <defunct>    
  665 apache    15   0 86992  13m 5644 S  0.3  0.2   0:00.20 httpd              
32218 apache    15   0 87356  14m 6344 S  0.3  0.2   0:00.53 httpd              
    1 root      15   0  2160  640  556 S  0.0  0.0   0:01.18 init  

From top, there is an occasional httpd <defunct> showing up. What does it do?

I found that the web server sometimes does not response to FPDF (print PDF at user's request). Is it related?

UPDATE, with loading information:

top - 11:55:59 up 17:30,  6 users,  load average: 0.53, 0.47, 0.80
Tasks: 322 total,   1 running, 320 sleeping,   0 stopped,   1 zombie
Cpu(s):  0.7%us,  0.2%sy,  0.0%ni, 95.1%id,  3.9%wa,  0.0%hi,  0.1%si,  0.0%st
Mem:   6219412k total,  5944068k used,   275344k free,    21024k buffers
Swap:  5140792k total,       96k used,  5140696k free,  5270708k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
 1951 apache    16   0     0    0    0 Z  0.9  0.0   0:00.33 httpd <defunct>    
 2267 apache    15   0 86992  13m 5876 S  0.9  0.2   0:00.22 httpd              
 3302 mysql     15   0  156m  41m 4756 S  0.9  0.7  11:43.72 mysqld             
 2220 apache    15   0 87204  14m 6496 S  0.6  0.2   0:00.28 httpd              
 2340 apache    15   0 87828  13m 5588 S  0.6  0.2   0:00.22 httpd              
 2341 apache    17   0 88236  14m 5564 S  0.6  0.2   0:00.15 httpd              
  842 apache    16   0 87432  15m 7180 S  0.3  0.2   0:00.81 httpd              
 2225 apache    18   0 88236  14m 5560 S  0.3  0.2   0:00.17 httpd              
 2401 apache    15   0 86916  12m 5344 S  0.3  0.2   0:00.11 httpd              
    1 root      24   0  2160  640  556 S  0.0  0.0   0:01.18 init               
like image 996
ohho Avatar asked Nov 15 '11 03:11

ohho


2 Answers

A defunct process is a process that has exited but whose parent has not yet waited on it to read its exit status, leaving an entry in the process table. Also known as a zombie process. See the Wikipedia article for more information.

like image 187
tvanfosson Avatar answered Oct 06 '22 00:10

tvanfosson


A defunct process is typically one which has finished but the OS keeps it around until the parent waits for it to "collect" its status. You only normally see lots of this when you've written your own "forky" code and have bugs.

If you use

ps -Hwfe

You will get to see the process hierarchy and so what the parent is. Weird that it's an httpd process, it's normally pretty good at collecting its children. Unless your system is flat out, which is why you're using top in the first place...

like image 43
Sodved Avatar answered Oct 05 '22 23:10

Sodved