On Wed, Mar 12, 2008 at 10:36:23AM +0200, Lars Nood??n wrote:
> How are zombies best dealt with, correctively?
>
> 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.
>
> kill -KILL seems to have no effect.
zombie processes are already dead, you cannot kill them.
>
> 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?
>
> And, is there a generic way to prevent them? The cause is a perl CGI
> called by apache2
zombie state happend if a child process exits, but its parent did not
execute a wait(2) system call (or one if its alternatives) for the
process (yet). So this seem a bug in the handling of CGIs.
-Otto
>
> Regards,
> -Lars