httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Trawick" <traw...@gmail.com>
Subject Re: [PATCH] #39275 MaxClients on startup [Was: Bug in 2.0.56-dev]
Date Thu, 20 Apr 2006 22:33:33 GMT
On 4/11/06, Chris Darroch <chrisd@pearsoncmg.com> wrote:
>
>    In my case, the problem relates to how long the child_init phase
> takes to execute.  I can "tune" this by raising DBDMin (and DBDKeep)
> so that mod_dbd attempts to open increasingly large numbers of
> DB connections during child_init.  With DBDMin set to 0 or 1,
> all is well; no funny behaviour.  Up at DBDMin and DBDKeep at 3,
> that's when (for me) things go pear-shaped.

I have been working with a user on one of these fork bomb scenarios
and assumed it was the child_init hook.  But after giving them a test
fix that relies on a child setting scoreboard fields in child_main
before child-init hooks run, and also adds some debugging traces
related to calling child-init hooks, it is clear that their stall
occurs BEFORE the child-init hook.  Which leaves a stretch of fairly
simple code.

(Best theory is bad stuff happening in an atfork handler registred by
a third-party module or some library it uses.  But that's besides the
point.)

Greg Ames and I chatted about this today and (98% Greg) came up with
the attached patch, which does not rely on the child storing anything
in the scoreboard in order to avoid the fork bomb.

I've played with it a bit on 2.0 but not trunk, which this patch is
for.  But the code's pretty much the same ;)

Mime
View raw message