in reply to Re^2: OT: Scalable web application architecture
in thread OT: Scalable web application architecture
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.
|
|---|