Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: When does it make sense to preload modules when starting Starman?

by perlfan (Vicar)
on Oct 29, 2021 at 08:42 UTC ( #11138180=note: print w/replies, xml ) Need Help??


in reply to When does it make sense to preload modules when starting Starman?

preloading in general makes sense when you are able to amortize the upfront penalty from start up over the lifetime of the running application. So if you have a highly stable application that's never restarted, then it's probably worth a few minutes of "warm up" time at the start. If you're going to be restarting often or the preload is simply too much work for the reward, then you're better off lazily loading at runtime via require.

Update - I thought I should add what I knew to be true (at some point) and isn't a secret, cPanel pays people a a lot of money to maintain a build infrastructure that uses B::C to generate a binary from Perl simply to improve start up time of their administrative daemon, cpservd. Basically, many MBs of initializations and module loads are shoved into a BEGIN{}. The binary is the state of the perl start up through BEGIN (like what you get by invoking perl -c). My point is that this is also an option - if you have a lot of stuff to preload, B::C can be used to get you into a state where start up actually picks up after BEGIN.

Replies are listed 'Best First'.
Re^2: When does it make sense to preload modules when starting Starman?
by karlgoethebier (Abbot) on Oct 30, 2021 at 08:25 UTC

    Holy Joe! I just wanted to be on the Bright Side of Life.

    Something like starman -Mstrict -Mwarnings -MPlack::Request -MPlack::App::URLMap -MPlack::App::URLMap. If the syntax is so. Untested. "Fire up and forget about it" was the basic theme. But i guess that i'm forced to do some forensics. Sometimes some things go totally wrong with a good cause. I wrote a very friendly email to the author. Result: undef. Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2022-01-21 18:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (59 votes). Check out past polls.

    Notices?