perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Swartz <>
Subject double mod_perl initialization
Date Fri, 25 Sep 2009 17:36:24 GMT
I was looking into why our server's restarts take so long, and I  
finally remembered that Apache runs its initialization step twice on  
startup ( This means that my is  
loaded twice, along with any modules that it loads.

So I moved to and put this in

     # Only run our real startup script the second time.
     use Apache2::ServerUtil ();
     if (Apache2::ServerUtil::restart_count() > 1) {
        require '';

And it shaved a bunch of time off our restart.

As I understand it, the sole purpose of this double initialization is  
to make sure that graceful restarts will work. However, since I was a  
young mod_perl lad I've been taught never to rely on graceful  
restarts, and always to stop/start.

If I don't ever plan to use graceful restarts, and I believe that  
smaller restart times are an unqualified Good, is there any reason why  
I shouldn't ALWAYS use a script like the above? And is there any way  
to avoid PerlModule modules from being loaded twice?


View raw message