Running a script under mod_perl can be a confusing world to learn about.

The point of mod_perl is that it's a Perl interpreter baked into the Apache web server. Instead of having to run the script (and therefore Perl) every time there's a web request, mod_perl loads the script in a ready-to-run form, so as to improve performance.

Falling back to food analogies (because they're easy for me), it's a bit like a diner making up a batch of pancake batter and having the griddle hot, so that when a customer shows up, the batter can go right onto the hot grill, and pancakes are up five minutes later. The alternative would be to make individual batches of batter for each customer who orders pancakes. I think you can imagine that's not as efficient.

Your experimental results show that Apache is dispatching a request to a variety of kids (diner kitchens), identified by pid. Each request is served (from that kitchen), showing a monotonically increasing count (pancake order count). You should be aware that there's a configuration parameter in the Apache config called something like MaxRequests. When a kid has maxed out its number of requests (that kitchen ran out of batter), it's terminated and a new kid is created (the kitchen makes up a new batch of batter).

Are you just seeing how it all works, or is there some issue that remains a mystery to you? mod_perl has been around for quite a while, but these days I'd guess it's now classified as old technology. :)

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.


In reply to Re: mod_perl children process by talexb
in thread mod_perl children process by LorCo

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.