Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > mod_perl on apache 1.3 and 2.0 performance test, old vs new. strage..

Thread Tools

mod_perl on apache 1.3 and 2.0 performance test, old vs new. strage..

Pablo S
Posts: n/a
Hi there Perl folks, I am comparing performance on a new server
platform I am demoing and wanted to share this weird thing:

It started out when I noticed some expensive local db calls on my
mod_perl box were taking a while on the new, slightly beefier system.
They are the same accept for:

OLD system:
(a celeron 1.8 w/ 512SDRAM linux 2.4 running perl 5.6.1,
postgresql-7.2.1-5 with a perl web db on Apache/1.3.23 mod_perl 1.26
and dbi 1.37 with peristent db connections via apache:dbi. ) this
thing runs awesome, as in, it is FAST, for what it does.

NEW system:
(a p4 2.6 w/ 512DDR266 running the same web app via perl 5.8.3 on
fedora core 2 linux 2.6 postgresql-7.4.2-1 w/ Apache/2.0.49 &
mod_perl/1.99_12 & apache:dbi.) it, at this point, sucks and is
noticably slower to load pages, pull from DBI, and even do simple

Httpd.conf on apache2.0
Alias /cgi-bin /var/www/cgi-bin
<Directory /var/www/cgi-bin>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI

and on 1.3
Alias /cgi-bin/ "/home/httpd/cgi-bin/"
<Location /cgi-bin>
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
allow from all
PerlSendHeader On

I have one page where I run many queries. On the old server, it loads
in 1.5 seconds. On the new server, with the same data, it takes 6. I
am trying to find out why. After going nuts all over Pg, apache:dbi,
and all orders of other stuff I had both servers run your basic

my $i=10000000;
while ($i) {
print "done!";

thing. The 1.8 is done in 2 seconds, the 2.4 takes almost 8.

Is apache the culprit? I was running all over looking at the database
I was talking to, etc etc, but heres a simple loop taking about 3x as

Thank you for your interest!! Any comments welcome.
Reply With Quote
Tore Aursand
Posts: n/a
On Tue, 31 Aug 2004 22:18:13 -0700, Pablo S wrote:
> [ Bad performance with Apache 2.x over Apache 1.x ]
> Is apache the culprit? I was running all over looking at the database I
> was talking to, etc etc, but heres a simple loop taking about 3x as
> long.

You have to hone your benchmarking skills. You'll easily find out if one
Apache version is serving slower than another Apache version by simple
running the 'ab' tool on a simple HTML file;

% /usr/local/apache/bin/ab -n 100000 -k -c 4 http://localhost/test.html

'test.html' should - of course - not contain very much. Just some simple
HTML markup with no outside references (ie. images, CSS files, etc.)

Moving on to the next step: Create a simple script like this:

use strict;
use warnings;

my $i = 100_000_000;
while ( $i > 0 ) {

Run this script with each of the Perl versions you have. Something tells
me that this really is a Perl issue, but that your fastest Perl version is
compiled differently than that slower Perl version.

I experienced the same thing when upgrading from Perl 5.6.0 to Perl 5.6.1;
The former was installed as plain RPM with all the fance stuff included,
while the latter was compiled specifically for the computer I was running
at that time, with just the necessary stuff enabled.

The result: Perl 5.6.1 was _a lot_ faster than the previous version, and
I could easily benchmark that from a simple "routine" as the one above.

I'll be happy to see your benchmark results!

Tore Aursand <(E-Mail Removed)>
"Why shouldn't truth be stranger than fiction? Fiction, after all, has
to make sense." (Mark Twain)
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
mod_perl installed, but file not created Perl Misc 2 01-25-2006 10:53 PM
mod_perl 2.0 and apache 2.2 Undefined subroutine &ModPerl::ROOT::ModPerl::Registry error it_says_BALLS_on_your forehead Perl Misc 0 01-24-2006 08:43 PM
what version of Perl do you use? i've installed apache 2.2 and will install mod_perl 2.0 it_says_BALLS_on_your forehead Perl Misc 0 01-13-2006 09:19 PM
mod_perl - dbi - DBD:Pg performance test, old vs new Pablo S Perl 0 09-01-2004 04:21 AM
starting apache with mod_perl, error on Selmar Perl Misc 2 07-21-2004 09:53 PM