On Wed, Mar 12, 2008 at 10:36:23AM +0200, Lars Nood??n wrote:
| How are zombies best dealt with, correctively?
By fixing the bugs in the parent.
| My OBSD 4.2 x86 machine is showing memory and CPU utilization are a
| negligable fraction of the total capacity. Yet, it is getting maxed out
| in regards to number of processes, apparently due to the zombies.
Zombies don't consume any (or, nearly any) resources apart form the
one pid.
| kill -KILL seems to have no effect.
Nope. Read up on 'em to find out why. Hint : you can't kill what's
already dead.
| Some interaction between Apache2 and perl is creating zombies. After
| several months, this number has crept up to close to a thousand and with
| kern.maxproc=1024, problems are starting
|
| For example, ps says :
| ...
| _apache2 97 0.0 0.0 0 0 ?? Z - 0:00.00 (perl)
| _apache2 19083 0.0 0.0 0 0 ?? Z - 0:00.00 (perl)
| _apache2 24147 0.0 0.0 0 0 ?? Z - 0:00.00 (perl)
| _apache2 30821 0.0 0.0 0 0 ?? Z - 0:00.00 (perl)
| _apache2 6995 0.0 0.0 0 0 ?? Z - 0:00.00 (perl)
| _apache2 26059 0.0 0.0 0 0 ?? Z - 0:00.00 (perl)
| _apache2 31087 0.0 0.0 0 0 ?? Z - 0:00.00 (perl)
| ...
|
| So again, what corrective measures can be taken to rid the machine of
| zombie processes?
Find the parent process and restart it. This process is buggy. You may
want to investigate alternative options or fix the code if you can.
| And, is there a generic way to prevent them? The cause is a perl CGI
| called by apache2
Zombies are part of unix, you *need* them in cases. Leaving them
dangling (for too long) is not good of course, clean-up is required. This
is the job of the parent process so the 'generic way' to *solve* these
issues is by fixing the parent process.
Cheers,
Paul 'WEiRD' de Weerd
--
>++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
+++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
http://www.weirdnet.nl/