in reply to Re^4: Getting mod_perl to actually 'activate'..
in thread Getting mod_perl to actually 'activate'..

It will be compiled when process executes it first time. It depends on the number of children and MaxRequestsPerChild how often it will be recompiled. You can't tell when all processes are good as they have limited by the MaxRequestsPerChild time of life and new processes may be created at any moment.

  • Comment on Re^5: Getting mod_perl to actually 'activate'..

Replies are listed 'Best First'.
Re^6: Getting mod_perl to actually 'activate'..
by MashMashy (Sexton) on Feb 16, 2009 at 17:57 UTC
    Hm, I think I see the problem now, or at least the 'correct question to ask'.

    See, currently in CGI, the code uses SelfLoader to only serve up the needed subs. in mod_perl, I had assumed that all of the subs would have to be loaded, so they could precompile.

    Is there another way? and could you give me the first couple steps of that 'way' (assuming one exists), so I can try it on?

      You were right the first time: under mod_perl you want them all to compile on the first hit, so don't use SelfLoader IF you use ModPerl::Registry or a mod_perl handler rather than PerlRun. If your MaxRequestsPerChild is set pretty high, it will rarely recompile.

      If you have to use PerlRun, you're stuck with things like SelfLoader, since it will compile every time.

      IIRC you can use SelfLoader with Registry. Or you can use AutoLoader.