Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: mod_perl installed but not faster

by ajt (Prior)
on Oct 18, 2002 at 10:55 UTC ( #206263=note: print w/ replies, xml ) Need Help??


in reply to mod_perl installed but not faster

A Perl script runs at the same speed independent of the interpretor's location: embedded (mod_Perl) or external (CGI). As Perl is big and can be slow to load via CGI, it's by avoiding this (Perl loads only once when you start Apache) that mod_Perl gains it's speed advantage.

If you want to load and run many small Perl sctipts then mod_Perl will make a huge difference. If you want to load and run only a few long running scripts then CGI is probably good enough.

There are other advantages to mod_Perl, for example you can get at the innards of Apache from Perl, but with this and other advantages comes complexity.

Unless I miss understand what you are doing, you are only timing the script in action, not the time to start the script and run it. Which is why they take the same amount of time to run, but the mod_perl one should start faster.

I hope you plan to upgrade Apache, the version you quote is a we bit old and there are know security problems with it. Actually, I think the same can be said of RH6.2.

Update: If you are curious about mod_Perl is then also look here:


--
ajt


Comment on Re: mod_perl installed but not faster
Re: Re: mod_perl installed but not faster
by true (Pilgrim) on Oct 18, 2002 at 11:10 UTC

    Yes, i was trying exactly that. I wanted to time the script in action. I was hoping the multiple requests into my virtual server would be served faster. (Both scripts are on the same server). Perhaps i should try and http get another script inside of the mod_perl folder. Hopefully that would prove faster. Thanks for your ideas! It does seem like it is installed correctly, i just need to learn how to harness it.

    BTW, The Apache security hole in 1.3 is patchable. i'm pretty happy with 6.2, it's old, but stable :o My secondary drive is 7.2 though, i am curious to see the differences between the two avec mod_perl.

      I did this and am now seeing a big increase in speed! By requesting a local HTTP request with mod_perl i was able to save 30 seconds for 500 LWP requests. I was also able to use $ENV{'MOD_PERL'} to verify my mod_perl install (mod_perl/1.23).
      The test: i did a Simple get for a virtual domain on my server This was a local request, through apache. I requested this test page 500 times. One loop ran without mod_perl, the other with mod_perl.
    • Without mod_perl the test took=35.6595680713654 seconds
    • With mod_perl the test took=5.24513804912567 seconds
    • A few more runs confirmed my results. Thanks PM world. Without this resource, mod_perl would have remained a mystery to me. Props to ajt for all the pointers.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (18)
As of 2014-12-18 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (58 votes), past polls