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

Re: best way to balance load to a Perl script

by thunders (Priest)
on Jul 25, 2009 at 23:59 UTC ( #783240=note: print w/replies, xml ) Need Help??

in reply to best way to balance load to a Perl script

You will get a fair bit of mileage by converting to a mod_perl handler. In that case you will at least lose the startup time of the perl interpreter. Copying/renaming the script is very unlikely to do anything. As far as your server is concerned calling multiple processes called "/usr/bin/perl /path/to/" is no more expensive than "/usr/bin/perl /path/to/"

What is perl actually doing in this case? Is it actually serving the audio? Or is it just drawing a page that has links to the audio files? In the former case, it may be that perl is not the best tool for the job.

Using multiple load balanced servers will definitely improve performance, but it's critical to identify where the bottleneck is first. Running the script from the command line with the core module Devel::DProf or the CPAN module Devel::NYTProf will help in identifying what's slow.

  • Comment on Re: best way to balance load to a Perl script

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://783240]
NodeReaper cleans and fillets

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2018-06-19 16:44 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (114 votes). Check out past polls.