Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: A Perl Daemon

by perrin (Chancellor)
on Sep 06, 2005 at 20:14 UTC ( #489664=note: print w/replies, xml ) Need Help??


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

There is PPerl and SpeedyCGI, but really they're about the same as using mod_perl. You haven't provided any reason why mod_perl wouldn't meet your needs here. Maybe if you gave a specific example of how you want to use this, it would become more clear.

Replies are listed 'Best First'.
Re^4: A Perl Daemon
by habit_forming (Monk) on Sep 06, 2005 at 21:31 UTC
    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 BigModuleTree.pm 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.

    --habit

      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.

      -xdg

      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?
Username:
Password:

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

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












    Results (63 votes). Check out past polls.

    Notices?