There was an excellent article on this very subject in Apache Today titled Improving mod_perl Driven Site's Performance -- Part VI: Forking and Executing Subprocesses from mod_perl.

In the very first paragraph, they point out, using fairly strong language:

It's desirable to avoid forking under mod_perl. Since when you do, you are forking the entire Apache server, lock, stock and barrel. Not only is your Perl code and Perl interpreter being duplicated, but so is mod_ssl, mod_rewrite, mod_log, mod_proxy, mod_speling (it's not a typo!) or whatever modules you have used in your server, all the core routines, etc.

They also point out that forking a process might be trying to do the "wrong thing". In the case that you want to send information to the browser, and then do some processing afterwards (sort of sounds like your case), that there is a cleanup handler. You can do that with something like:
my $r = shift; $r->register_cleanup(\&do_stuff); sub do_cleanup{ #some clean-up code here };
In this case, this Apache process isn't freed up to handle another request, but it also isn't causing you the overhead of another fork.

However, they do say that there are some cases where forking is necessary, and take you through proper steps to do so.

Good luck!
-Eric

In reply to Re: forking w/ mod_perl and DBI by andreychek
in thread forking w/ mod_perl and DBI by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.