If you have the opportunity to use mod_perl with Apache as has been mentioned, I'd like to suggest that you look into the PerlRequire. PerlRequire allows you to specify a startup script (typically called startup.pl). In that script I usualy list as many of the modules (.pm) files, as use/require statements, that I'll be using from within the server environment as possible. I also write my sites as modules instead of straight CGIs for a variety of reasons, this being one of them.
mod_perl will execute that script at server startup, loading in much of the website. The importiant thing is that this is done before apache forks it's children, so much of the codebase can stay pre-loaded/pre-compiled in shared memory. Copy-on-write is a big win here.
This makes for a slighly slower startup time, but the improvements in memory consumption and initial request performance make for better overall performance.
With mod_perl turned all the way up (no PerlRunOnce, etc.), you'll get better performance at the cost of greater memory usage, though with the improved performance you can usualy tune down the number of servers.
Another configuration with mod_perl/Apache is to put a non-mod_perl apache instance in front of the mod_perl instance and have the non-mod_perl server handle all of the static content requests (like images, pdfs, plain html files, etc.). That keeps the mod_perl servers in reserve to do the dynamic content generation.
If you want to do this, I'd suggest looking into using Apache's RewriteEngine directives. Mandrake used to set up multiple instances of apache this way out of the box.
hth,
Kyle
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.