Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Optimizing a web application for the best performance

by ides (Deacon)
on May 03, 2007 at 14:51 UTC ( #613392=note: print w/ replies, xml ) Need Help??


in reply to Optimizing a web application for the best performance

You're thinking about memory use, at least in a mod_perl environment, incorrectly. What you should do is preload all of the modules you use in a startup.pl, in a <Perl> section, or if you really like typing a lot with PerlModule directives in your httpd.conf.

This loads the module into the server at startup and then can share the memory used by the module with all of the Apache children, and thus your CGIs and mod_perl handlers.

So for example say My::Foo module uses up 200k of memory. If you simply use My::Foo; in your programs then you will use 200k per Apache child process. However, if you preload it then you will use 200k in total no matter how many children are currently in use.

NOTE: This isn't a perfect representation, as you are only sharing the module's code itself and not any of the data structures it creates at run time. But this is how you should be thinking about it.

Frank Wiles <frank@revsys.com>
www.revsys.com


Comment on Re: Optimizing a web application for the best performance

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2014-09-02 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (20 votes), past polls