Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: How best to optimize shared data

by eclark (Scribe)
on Feb 04, 2005 at 23:19 UTC ( #428240=note: print w/replies, xml ) Need Help??


in reply to How best to optimize shared data

Have your script read all the configuration data into a perl data structure and then fork() into seperate processes. This way you let your OS deal with it. I dont know anything about HP-UX, but in Linux those memory pages containing your read-only data will remain shared across all processes until one changes, then it will get a private copy of the memory page that it changed. If you're clever, you can have the child process monitor its memory usage, kill itself and have the parent fork() another when too much memory is no longer shared.

I have done this with Apache and mod_perl. Simply populate some globals through the apache config file.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2022-05-25 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (90 votes). Check out past polls.

    Notices?