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

Discussion in 'Perl Misc' started by Pablo S, Sep 1, 2004.

  1. Pablo S

    Pablo S Guest

    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.
    Pablo S, Sep 1, 2004
    1. Advertisements

  2. Tore Aursand

    Tore Aursand Guest

    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 <>
    "Why shouldn't truth be stranger than fiction? Fiction, after all, has
    to make sense." (Mark Twain)
    Tore Aursand, Sep 1, 2004
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kload
    Oct 23, 2003
  2. Pablo S
    Pablo S
    Sep 1, 2004
  3. sf-newsgroup
    David Solimano
    Feb 12, 2012
  4. Selmar
    Jul 21, 2004
  5. Replies:
    Big and Blue
    Jan 25, 2006

Share This Page