blokhead has asked for the wisdom of the Perl Monks concerning the following question:
Each page request takes about .5-.6 seconds to execute, which is a little much for my taste. So I wanted to try running it under mod_perl. I profiled the program, and found that MyApp::BEGIN takes up about 70% of the execution time, because it in turn loads the other dozen modules. (In fact, that's the only thing I can see that is done in BEGIN) It was my understanding that in mod_perl, the modules would be loaded once and then stay resident in memory for subsequent requests, thus saving the time taken by BEGIN. However, this didn't turn out to be the case. In fact, things were about 5-10% slower under mod_perl.# application.pl use MyApp; MyApp->run;
Am I missing something big here? I'm quite new to mod_perl, and perhaps there is a more optimized way to load all my modules. How should I structure my application so that the modules are memory-resident in mod_perl? It would be really nice to get request times down to around .1 or .2 seconds. Thanks in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: mod_perl application structure
by Ovid (Cardinal) on Aug 23, 2002 at 22:02 UTC | |
|
Re: mod_perl application structure
by perrin (Chancellor) on Aug 23, 2002 at 21:59 UTC | |
by blokhead (Monsignor) on Aug 23, 2002 at 22:13 UTC | |
by perrin (Chancellor) on Aug 23, 2002 at 22:27 UTC | |
|
Re: mod_perl application structure
by trs80 (Priest) on Aug 23, 2002 at 22:04 UTC |