I hope it is clear that you don't want fork the whole server!

Mod_cgi goes to great pains to effectively fork a subprocess, and
was the major impetus I believe for the development of
the C subprocess API. It  (the source code for
mod_cgi) is a great place to learn some of the
subtleties as the Eagle book points out. As the Eagle book
says, Apache is a complex beast. Mod_perl gives
you the power to use the beast to your best advantage.

Now you are faced with a trade off.  Is it more expensive to
detach a subprocess, or use the child cleanup phase to do
some extra processing? I'd have to know more specifics to answer
that with any modicum of confidence.

Cheers,

Ed


"David E. Wheeler" wrote:

> ed phillips wrote:
> >
> > Hi David,
> >
> > Check out the guide at
> >
> > http://perl.apache.org/guide/performance.html#Forking_and_Executing_Subprocess
> >
> > The Eagle book also covers the C API subprocess details on page 622-631.
> >
> > Let us know if the guide is unclear to you, so we can improve it.
>
> Yeah, it's a bit unclear. If I understand correctly, it's suggesting
> that I do a system() call and have the perl script called detach itself
> from Apache, yes? I'm not too sure I like this approach. I was hoping
> for something a little more integrated. And how much overhead are we
> talking about getting taken up by this approach?
>
> Using the cleanup phase, as Geoffey Young suggests, might be a bit
> nicer, but I'll have to look into how much time my processing will
> likely take, hogging up an apache fork while it finishes.
>
> Either way, I'll have to think about various ways to handle this stuff,
> since I'm writing it into a regular Perl module that will then be called
> from mod_perl...
>
> Thanks,
>
> David

Reply via email to