* SUMMARY: Defunct processes
@ 1996-01-11 18:46 James Anderson
0 siblings, 0 replies; 2+ messages in thread
From: James Anderson @ 1996-01-11 18:46 UTC (permalink / raw)
To: tru64-unix-managers
My thanks to:
swatson@ultrix6.cs.csubak.edu
trulsonj@mscd.edu
matthewm@sgate.com
yanowitz@eternity.cs.umass.edu
svardhan@siwest.cts.com
For the rundown on what defunct processes are and what can be done if they
linger. Here's a synopsis of what I found out, my thanks to Sean Watson for
this write up. (They were all great writeup, I flipped a coin as to which on
to use...)
Jim
> Can some one give some insight into a defunct process:
>
> 1. What is it?
>
This is what happens when a process dies:
(1) All open files, sockets, shared memory, etc are released (hopefully)
(2) All non-shared memory (data/text/bss segments)
(3) All child process are reparented by pid 1 (init)
(4) The exit value is stored in the process table.
(5) A SIGCHLD is sent to the parent (pid 1 if its true parent has exited)
(At this point, the only resouuces the process is taking is its slot
in the process table. The process is "defunct" (aka a "zombie")
and may stay that way for an indefinite amount of time until....
(6) The parent (or pid 1) calls wait() (or waitpid(), etc), collects
the exit value, resources (cpu time, memory usage, etc) are accounted
against the parent, and the process slot is freed.
It's a process slot entry that has not been reaped from its parent yet. The
actual process is dead and is not taking up any system resources -- other
than the process table entry.
> 2. What causes it?
>
A parent may be coded sloppily and not call wait when it should --or-- the
parent may be busy and not want to wait on the child --or-- the system
may be so busy the parent doesn't get to run for a while.
> 3. How to prevent it?
>
Write better code; run fewer processes; don't sweat it when it happens.
> 4. How to kill them?
>
You can kill their parents which will force init (pid 1) to inherit them
and wait on them (probably promptly). Waitpid can only be called on a
processes direct children (not even grandchildren can be waited on), so
you must either force a parent to wait on its children or kill the parent.
Mostly, it is safe to ignore zombies as long as you don't have thousands
of them. I seem to recall a server that listened at a socket, when it
got a connection it forked a child, to handle the connection, waited on
any children that had exited, and went back to listening at the socket. The
result was there was always one single zombie but the server always
spent as much time as possible listening at its socket and only dealt with
waiting on children after the current connection was taken care of.
I think this was a little extreme, but then again, I don't think there was
anything particularly wrong with it.
----
_______________________________________________________________________________
James C. Anderson PHONE: (216) 775-6929
Houck Computing Center FAX: (216) 775-8573
Oberlin College Email: anderson@ocaxp1.cc.oberlin.edu
Oberlin, OH 44074 Home Page: http://www.oberlin.edu/~anderson/
_______________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
* SUMMARY: Defunct Processes
@ 2001-12-05 22:00 Jonathan Williams
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Williams @ 2001-12-05 22:00 UTC (permalink / raw)
To: tru64-unix-managers
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: multipart/mixed; boundary="------=_NextPart_000_003B_01C17DAE.5C0DE300", Size: 6369 bytes --]
This is a multi-part message in MIME format.
------=_NextPart_000_003B_01C17DAE.5C0DE300
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Ok...tons of responses. Everybody agrees on what a defunct process is:
"As I understand it, they exist because they were child processes which
were created, ended, but not waited on by their parents. They cannot
be killed since they are already dead. In order for them to go away,
their parent process needs to wait on them, which is apparently not
happening. The two ways I know how to make this happen would be
either to get their parent processes to wait on them, which is likely
impossible, or to kill the parent processes so that the children will
be orphaned and adopted by the system, which will then wait on them,
at which point they will go away. The only alternative is to reboot
the machine."
So I looked at the ps -ef|grep defunct, and did notice that all of the =
defunct processes had the same parent. It is one of the Xipc daemons =
(xipcisd to be precise if anyone out there uses Xipc). We haven't fixed =
it yet, but I can happily pass it on to Envoy (the most recent Xipc =
purchasers) for them to fix the problem. =20
Thanks to everyone who responded.
Jonathan Williams
Unix Systems Administrator
The Shubert Organization, Inc.
-----Original Message-----
From: Jonathan Williams [mailto:jonathw@shubertorg.com]
Sent: Wednesday, December 05, 2001 1:45 AM
To: Tru64 Mailing List
Subject: Defunct processes
Ok...we have 3 production servers--Alpha ES40 running Tru64 5.1 Patch =
Kit 3.
We have noticed a ton of defunct processes running on the server that is =
the
"online" server. These processes don't appear in near the same numbers =
on
the backup servers--but if we bring a backup server online, the defunct
processes start appearing. I was curious last night and ran the =
following:
ps -A |grep defunct | wc -l and there were right around 10400 defunct
processes. Now I have no idea what a defunct process is. Also I'm not =
sure
how bad they are, because they've been there for a long time (months and
months and months) but just today the big-boss-man decided that they =
need
to be looked into. So my very general questions are: what are these
processes, are they normal or is there something wrong with our =
production
application (big surprise there), and what do we do about them? The =
only
things these systems are running is: TU 5.1, Informix (IDS 2000, client
SDK, and SQL), Passport, and Xipc. I know it's a very general
question...but I just need to know where to start investigating. =20
------=_NextPart_000_003B_01C17DAE.5C0DE300
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3207.2500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Ok...tons of responses. Everybody =
agrees on=20
what a defunct process is:</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>"As I understand it, they exist because =
they were=20
child processes which<BR>were created, ended, but not waited on by their =
parents. They cannot<BR>be killed since they are already =
dead. In=20
order for them to go away,<BR>their parent process needs to wait on =
them, which=20
is apparently not<BR>happening. The two ways I know how to make =
this=20
happen would be<BR>either to get their parent processes to wait on them, =
which=20
is likely<BR>impossible, or to kill the parent processes so that the =
children=20
will<BR>be orphaned and adopted by the system, which will then wait on=20
them,<BR>at which point they will go away. The only alternative is =
to=20
reboot<BR>the machine."<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>So I looked at the ps -ef|grep defunct, =
and did=20
notice that all of the defunct processes had the same parent. It =
is one of=20
the Xipc daemons (xipcisd to be precise if anyone out there uses =
Xipc). We=20
haven't fixed it yet, but I can happily pass it on to Envoy (the most =
recent=20
Xipc purchasers) for them to fix the problem. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks to everyone who =
responded.</DIV></FONT>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Jonathan Williams<BR>Unix Systems=20
Administrator<BR>The Shubert Organization, Inc.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>-----Original Message-----<BR>From: =
Jonathan=20
Williams [<A=20
href=3D"mailto:jonathw@shubertorg.com">mailto:jonathw@shubertorg.com</A>]=
<BR>Sent:=20
Wednesday, December 05, 2001 1:45 AM<BR>To: Tru64 Mailing =
List<BR>Subject:=20
Defunct processes<BR><BR><BR>Ok...we have 3 production servers--Alpha =
ES40=20
running Tru64 5.1 Patch Kit 3.<BR>We have noticed a ton of defunct =
processes=20
running on the server that is the<BR>"online" server. These =
processes=20
don't appear in near the same numbers on<BR>the backup servers--but if =
we bring=20
a backup server online, the defunct<BR>processes start appearing. =
I was=20
curious last night and ran the following:<BR>ps -A |grep defunct | wc=20
-l and there were right around 10400 =
defunct<BR>processes. Now=20
I have no idea what a defunct process is. Also I'm not sure<BR>how =
bad=20
they are, because they've been there for a long time (months =
and<BR>months and=20
months) but just today the big-boss-man decided that they =
need<BR>to be=20
looked into. So my very general questions are: what are=20
these<BR>processes, are they normal or is there something wrong with our =
production<BR>application (big surprise there), and what do we do about=20
them? The only<BR>things these systems are running is: TU =
5.1,=20
Informix (IDS 2000, client<BR>SDK, and SQL), Passport, and Xipc. I =
know=20
it's a very general<BR>question...but I just need to know where to start =
investigating. <BR><BR></FONT></DIV></BODY></HTML>
------=_NextPart_000_003B_01C17DAE.5C0DE300--
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-12-05 22:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-01-11 18:46 SUMMARY: Defunct processes James Anderson
-- strict thread matches above, loose matches on Subject: below --
2001-12-05 22:00 SUMMARY: Defunct Processes Jonathan Williams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox