httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <>
Subject Re: Scoreboard API
Date Wed, 26 Aug 2009 10:27:15 GMT
William A. Rowe, Jr. wrote:

> Well, the original question was more oriented to additional-data-per-slot.
> It should be fairly straightforward to allocate a shm to track children
> (for example, mod_fcgid does this) but it seemed silly to create a whole
> new shm for a handful of bytes per worker, when the data is worker oriented.
> The API would have a few issues; it becomes impossible to gracefully
> restart when adding the module; when removing the module the space must
> still be fixed at its initial allocation.
> If you want to create more "workers", that sounds outside the scope of this
> initial thought, and more in line with mpm design, so your direction seems
> like an extention to the mpm logic (if they will be 'workers' with
> 'requests').

Thanks for your thoughts.  The graceful restart issue is indeed one
I have not thought through.

As regards MPM logic, yes and no.  Yes, that is certainly where I'm
heading in terms of the 2.0/2.2 design.  But I'm trying very hard
to do that without writing a new MPM.  I want to write a module
that will be compatible with every MPM, and I'm looking to least-
disruptive hooks in to what is currently MPM-private in order to
be able to interact with MPM logic.

OK, let's explain a bit more.  The problem at hand is to be able
to create child_init/drop_privileges functions that will act
differently on different children:

   child1 --> normal child as we know it
   child2 --> special-purpose slave

Once the configuration is determined, the module allocates
a record of all special slaves in a (hypothetical)
setup_scoreboard phase.  Then the child_init hook checks
the scoreboard for any vacant special-slave slots, and
becomes the slave if there's a vacancy, noting its PID
as occupying that slot.

Having the record in scoreboard serves to keep track
of the slave children over child_exits, and enables
children to be treated unequally without having to
hack it into the code of any (or every) existing MPM.
Bit of modularity, like we have everywhere else!

Nick Kew

View raw message