Re: How to test if I got Mod_Perl in apache?
From: Douglas Hunter (dug_at_plusthree.com)
Date: 10/03/04
- Next message: Bob Walton: "Re: Why a Perl script ran on Shell andr Windows but not on Apache Linux?"
- Previous message: Gunnar Hjalmarsson: "Re: How to test if I got Mod_Perl in apache?"
- In reply to: Sherm Pendley: "Re: How to test if I got Mod_Perl in apache?"
- Next in thread: Gunnar Hjalmarsson: "Re: How to test if I got Mod_Perl in apache?"
- Reply: Gunnar Hjalmarsson: "Re: How to test if I got Mod_Perl in apache?"
- Reply: Sherm Pendley: "Re: How to test if I got Mod_Perl in apache?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 3 Oct 2004 14:21:14 GMT
On 2004-10-03, Sherm Pendley <spamtrap@dot-app.org> wrote:
> Gunnar Hjalmarsson wrote:
>
>> Quote from http://perl.apache.org/start/tips/registry.html :
>>
>> "Existing CGI scripts will run much faster under mod_perl."
>
> That has not been my experience - and I've done a *lot* of mod_perl, for
> sites that get more traffic than slashdot.
>
I'd be interested in hearing more about your typical configuration. Do
you use fastcgi or Pperl? I believe that statement assumes a typical CGI
environment rather than a persistent one.
> On the other hand, the scripts I've worked with have been as small and
> tight as I could make them to begin with. They didn't benefit all that
> much by simply dropping them into Apache::Registry, since the compiler
> overhead for those scripts wasn't all that much to begin with.
I just benched the smallest and tightest script I could come up with:
#!/usr/bin/perl
print "Content-Type: text/html\r\n\r\n";
print "<html>Hello World!</html>";
{grin}
A vanilla CGI run of 3000 (using ab -n 3000) gave me 175.36 requests per
second. Moving that over to mod_perl and Apache::Registry gave me
298.15. I'd call that a significant difference. Of course, those
numbers will favor mod_perl even more as the complexity of the script
grows, especially if folks follow best practices and pre-load heavy
modules before apache forks.
Running 20 concurrent processes (ab -n 3000 -c 20) shows even more favor
for mod_perl: 371.24 for mod_perl to 187.85 for CGI.
>
> I can see where the difference would be much more dramatic though, if
> you're dealing with a 10kloc behemoth that spends as much or more time
> compiling than it does running. ;-)
Unless one is running in a persistent environment such as fastcgi or
Pperl, the basic fork and exec that is needed to execute a cgi script
causes a significant amount of overhead, meaning a win for simply
switching to mod_perl. Of course, you are correct in saying that as
things grow more complex that the difference becomes more dramatic
{grin}.
>
> sherm--
>
-- Douglas Hunter
- Next message: Bob Walton: "Re: Why a Perl script ran on Shell andr Windows but not on Apache Linux?"
- Previous message: Gunnar Hjalmarsson: "Re: How to test if I got Mod_Perl in apache?"
- In reply to: Sherm Pendley: "Re: How to test if I got Mod_Perl in apache?"
- Next in thread: Gunnar Hjalmarsson: "Re: How to test if I got Mod_Perl in apache?"
- Reply: Gunnar Hjalmarsson: "Re: How to test if I got Mod_Perl in apache?"
- Reply: Sherm Pendley: "Re: How to test if I got Mod_Perl in apache?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|