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

Re^4: A Perl Daemon

by habit_forming (Monk)
on Sep 06, 2005 at 21:31 UTC ( #489691=note: print w/replies, xml ) Need Help??

in reply to Re^3: A Perl Daemon
in thread A Perl Daemon

Good point. The reason mod_perl does not meet my needs is because the code these scripts will be running does a lot of forking. The scripts do a lot of qx()'ing and system()'ing and such. And while I have tried to influence those writing these scripts not to do this, the problem persists. After all there are some good reasons to qx(). I tried mod_perl for quite some time and while much much faster I was getting strange behavior from Apache. Once I moved to CGI the strange behavior (i.e. defunct processes, unkillable children(hung on sockets), out of semaphore space errors, etc) cleared up completely. That is why I begrudgingly moved off of mod_perl.

My base problem here is that I have a number of scripts that use a large complex of code. That complex of code is so large that this perl -MBigModuleTree -e 1 takes an average of 1.1 seconds. Yeah, it is pretty bad. So I am looking for a way to preload the thus reducing the time it takes to execute these scripts and also hopefully bringing the load down on the box.
Hope this clears things up a bit.


Replies are listed 'Best First'.
Re^5: A Perl Daemon
by xdg (Monsignor) on Sep 06, 2005 at 21:56 UTC

    If you need something that task specific, then maybe doing something standalone with Net::Server would be a workable approach. You could load up BigModuleTree in your server script and then have the server prefork and wait for inbound work requests. Then just have your cgi script (under mod_perl or not) call out to the standalone server to do the work. You could serialize the CGI parameters and pass them over the connection to control behavior and then read back the response.

    POE could be another standalone environment that might work for you.


    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2022-01-22 19:01 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (63 votes). Check out past polls.