You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Daniel Ruggeri <DR...@primary.net> on 2014/04/14 18:06:25 UTC

Zombies from rotatelogs

I was taking a look at a server that had a handful of zombies and came
to see they are caused by rotatelogs. It seems pretty straight forward
why - I am calling gzip post-rotate to compress the log file and child
cleanup only happens during the post_rotate function, but before
apr_proc_create for this rotation. So, effectively, you will have a
zombie process from time_child_dies to next_rotation.

I would like to get rid of those zombie processes sooner but am wary to
call apr_proc_wait_all_procs very often... I don't know what the expense
of doing that would be.

So... I'm seeking advice for the best option here:
*Call apr_proc_wait_all_procs in the main loop (expensive?)
*Spawn a thread on the side to reap the child a la blocking mode
*Check an interval in the main loop to call apr_proc_wait_all_procs once
per X time
*or... your idea

Thanks

P.S.
ApacheCon was a blast - can't wait until next one!

--
Daniel Ruggeri

Re: Zombies from rotatelogs

Posted by Daniel Ruggeri <DR...@primary.net>.
On 4/14/2014 11:41 AM, Joe Orton wrote:
> It's free... dunno why I didn't think of this before.
>
> http://svn.apache.org/viewvc?view=revision&revision=1587255
>
> Regards, Joe

Awesome - proposed for backport in 2.4. Thanks!

-- 
Daniel Ruggeri


Re: Zombies from rotatelogs

Posted by Joe Orton <jo...@redhat.com>.
On Mon, Apr 14, 2014 at 11:06:25AM -0500, Daniel Ruggeri wrote:
> I was taking a look at a server that had a handful of zombies and came
> to see they are caused by rotatelogs. It seems pretty straight forward
> why - I am calling gzip post-rotate to compress the log file and child
> cleanup only happens during the post_rotate function, but before
> apr_proc_create for this rotation. So, effectively, you will have a
> zombie process from time_child_dies to next_rotation.
> 
> I would like to get rid of those zombie processes sooner but am wary to
> call apr_proc_wait_all_procs very often... I don't know what the expense
> of doing that would be.
> 
> So... I'm seeking advice for the best option here:

It's free... dunno why I didn't think of this before.

http://svn.apache.org/viewvc?view=revision&revision=1587255

Regards, Joe