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

Okay, this is the meat of the problem, then. Rather than make a new thread, mind if I talk about it here?

Here are the questions I'm getting hug up on, it seems:
1. how often will these be 'recompiled'?
2. how can I tell when all the 'child processes' are good to go (i.e. all preloaded)
3. should I expect these to re-"precompile" on me? This code is being hit by a great many different users once a day - will it compile for each user, or only until all the 'child processes' are good to go?
3b. am I thinking of 'child processes' incorrectly here?

Again, Thanks so much - you are turning a light on in a dark room. :)
  • Comment on Re^4: Getting mod_perl to actually 'activate'..

Replies are listed 'Best First'.
Re^5: Getting mod_perl to actually 'activate'..
by MashMashy (Sexton) on Feb 16, 2009 at 17:49 UTC
    Oh, and, would that 'counter' script you put in actually work under ::PerlRun?
      No, you're right, that will only work with Registry. You should really try to get your code running under Registry if you want speed.
Re^5: Getting mod_perl to actually 'activate'..
by zwon (Abbot) on Feb 16, 2009 at 17:53 UTC

    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.

      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.