Python and Zope

Ignacio Vazquez-Abrams ignacio at openservices.net
Mon Sep 10 12:33:48 EDT 2001


On Mon, 10 Sep 2001, Oleg Broytmann wrote:

> On Sun, Sep 09, 2001 at 11:07:15AM -0400, Ignacio Vazquez-Abrams wrote:
> > >    Apache modules are just CGIs. Apache forks off a child at random, and at
> > > random kills children. On the other hand, web-application server is always
> > > in memory. This allows for the server to create persistence connection to a
> > > DB. How can you implement persistence connection in Apache module? Those
> > > "solutions" that are in mod_perl and mod_python are (in my not so humble
> > > opinion) just unstable hacks.
> >
> > Also, Apache does not fork and kill children at random. A certain minimum
> > number of children are created at startup, more are created up to a maximum
> > number if necessary, and once a child has served a certain number of
> > connections, it is killed. This results in maximum stability because any
> > memory problems only have a limited amount of time to live.
>
>    "At random" meant "out of control of the module". A module cannot
> predict forking/killing, it cannot even get information about it. It is not
> the module who controls forking and killing - it is Apache.

Yes, but there are always enough children to service incoming requests unless
the maximum linit has already been reached. That's no different than a
multithreaded application server. You woudn't expect both of them to expand
until the machine that it is on rolls over and dies.

And while fork() may be more expensive than clone(), once the process or
thread has been created then the context-switch time is not all that
different. In fact, it may be faster to do the process context-switch if the
threading is done in user-space.

-- 
Ignacio Vazquez-Abrams  <ignacio at openservices.net>





More information about the Python-list mailing list