Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: OT: Scalable web application architecture

by badaiaqrandista (Pilgrim)
on Dec 08, 2005 at 23:36 UTC ( [id://515418]=note: print w/replies, xml ) Need Help??


in reply to Re: OT: Scalable web application architecture
in thread OT: Scalable web application architecture

Yes I preload everything. Does it has anything to do with scalability?

badaiaqrandista
  • Comment on Re^2: OT: Scalable web application architecture

Replies are listed 'Best First'.
Re^3: OT: Scalable web application architecture
by dragonchild (Archbishop) on Dec 09, 2005 at 03:51 UTC
    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:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://515418]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-23 06:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found