in reply to mod_perl reloading handler on each call

It's not reloading your module, but rather loading it once in each process. After that it stays in memory until another new process is spawned. You should load the module in your startup.pl to avoid this. It will work fine as is, but you will save some memory by loading it before apache forks.
  • Comment on Re: mod_perl reloading handler on each call

Replies are listed 'Best First'.
Re^2: mod_perl reloading handler on each call
by BigLug (Chaplain) on Jan 10, 2005 at 03:42 UTC
    You are right! Thankyou for restoring my sanity!

    I changed the code an introduced a global $output then inside handler() I set $output ||= $c->param('output');. Upon each run I got the script to output $output.

    Then I kept calling the script with a different output: output=1, output=2 etc ... once I got to 9, the printed result was 'Output: 1' ... which means it had got to the end of the available processes and reused the first one again :))

    Thanks again!


    Cheers!
    Rick
    If this is a root node: Before responding, please ensure your clue bit is set.
    If this is a reply: This is a discussion group, not a helpdesk ... If the discussion happens to answer a question you've asked, that's incidental.
      You can see what's happening more simply by just printing the process id, $$, in your warning.