Yes, quite a lot. The more you can preload in your startup.pl, the more there is in shared memory. The more you have in shared memory, the less memory each Apache child takes. The less each takes, the more children you can have running simultaneously. The more simultaneous children you have running, the more simultaneous requests you can serve.
* Instant scalability.
This doesn't just apply to your modules. One thing I have done in the past is to preload large constant data structures that are stored in the database. You can do this by loading them as a singleton class in your startup.pl. You can then access them by accessing the singleton class. It's kinda like global variables for your mod_perl application, but not sucky. You could also mark them with ReadOnly for even greater safety.
Note that preloading only works if you don't modify the stuff you preloaded. If you do, then it's copied into the child's memory and you lose the benefits.
*: Stas Bekman (the author of mod_perl) wrote an excellent 8-part series on optimizing your mod_perl application. Parts 3-5 discuss shared memory. They're a little difficult to get into, but you'll learn a ton about how to improve your mod_perl app's performance.
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
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.