Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

some flawed benchmarks

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


adam.prime at utoronto

Jul 9, 2008, 10:28 PM

Post #1 of 10 (1277 views)
Permalink
some flawed benchmarks

A couple of months ago i was going through slides from gozers "From
CGI to mod_perl 2.0, Fast!" talk, which has some benchmarks comparing
CGI, perlrun and registry to each other. At which point i realized
that i've never really known how much faster using straight handlers
is than using one of the CGI emulation layers. I also didn't have any
idea how much faster SetHandler modperl was vs SetHandler perl-script.

So i decided to see what i could figure out. I took gozers CGI from
the slides (slightly modified) and ran it through the paces on my
laptop, then converted the script to run as a straight handler.

here's the CGI version:

#!/usr/bin/perl


print qq[Content-Type: text/html\r\n\r\n];

print(qq[.
<html><body>
<h1>Hello Worlds</h1>
<pre>
GATEWAY_INTERFACE: $ENV{GATEWAY_INTERFACE}
MOD_PERL: $ENV{MOD_PERL}
</pre>
</body></html>

]);


Here's the Handler version

package Kabob::HelloWorld;

use strict;
use warnings;

use Apache2::RequestRec ();

use Apache2::Const -compile =>qw(:common);

sub handler {
my $r = shift;

$r->content_type('text/html');
$r->print(qq[.
<html><body>
<h1>Hello Worlds</h1>
<pre>
GATEWAY_INTERFACE: $ENV{GATEWAY_INTERFACE}
MOD_PERL: $ENV{MOD_PERL}
</pre>
</body></html>


]);

return Apache2::Const::OK;
}

1;

and here's the conf (these tests were all running through a light
mod_proxy front end too)


<Location /cgi/>
<IfDefine FrontEnd>
ProxyPass http://localhost:8080/cgi/
ProxyPassReverse http://localhost:8080/cgi/
</IfDefine>
</Location>
<IfDefine BackEnd>
ScriptAlias /cgi/ /www/p/
</IfDefine>


Alias /perlrun/ /www/p/
<Location /perlrun/>
<IfDefine FrontEnd>
ProxyPass http://localhost:8080/perlrun/
ProxyPassReverse http://localhost:8080/perlrun/
</IfDefine>
<IfDefine BackEnd>
SetHandler perl-script
PerlHandler ModPerl::PerlRun
Options +ExecCGI
PerlSendHeader On
</IfDefine>
</Location>

Alias /registry/ /www/p/
<Location /registry/>
<IfDefine FrontEnd>
ProxyPass http://localhost:8080/registry/
ProxyPassReverse http://localhost:8080/registry/
</IfDefine>
<IfDefine BackEnd>
SetHandler perl-script
PerlHandler ModPerl::Registry
Options +ExecCGI
PerlSendHeader On
</IfDefine>
</Location>



<Location /perlscript/>
<IfDefine FrontEnd>
ProxyPass http://localhost:8080/perlscript/
ProxyPassReverse http://localhost:8080/perlscript/
</IfDefine>
<IfDefine BackEnd>
SetHandler perl-script
PerlResponseHandler Kabob::HelloWorld
</IfDefine>
</Location>

<Location /modperl/>
<IfDefine FrontEnd>
ProxyPass http://localhost:8080/modperl/
ProxyPassReverse http://localhost:8080/modperl/
</IfDefine>
<IfDefine BackEnd>
SetHandler modperl
PerlResponseHandler Kabob::HelloWorld
</IfDefine>
</Location>


and here's the results (which are no doubt flawed for a number of reasons)

running: ab -n 10000 [url]

CGI
Requests per second: 217.80 [#/sec] (mean)
Time per request: 4.591 [ms] (mean)
Transfer rate: 53.17 [Kbytes/sec] received

PerlRun
Requests per second: 482.49 [#/sec] (mean)
Time per request: 2.073 [ms] (mean)
Transfer rate: 114.49 [Kbytes/sec] received

Registry
Requests per second: 693.33 [#/sec] (mean)
Time per request: 1.442 [ms] (mean)
Transfer rate: 164.53 [Kbytes/sec] received

SetHandler perl-script
Requests per second: 772.12 [#/sec] (mean)
Time per request: 1.295 [ms] (mean)
Transfer rate: 189.94 [Kbytes/sec] received

SetHandler modperl
Requests per second: 1048.66 [#/sec] (mean)
Time per request: 0.954 [ms] (mean)
Transfer rate: 250.84 [Kbytes/sec] received

I'm not sure how well you can really compare the CGI emulation numbers
to the PerlHandler numbers, but personally i think the 30%ish
improvement from perl-script to modperl is pretty amazing. I wouldn't
have imagined it would have been that high.

Adam


el.dodgero at gmail

Jul 10, 2008, 2:39 AM

Post #2 of 10 (1225 views)
Permalink
Re: some flawed benchmarks [In reply to]

I appreciate this, as I'd been wondering.

But it also prompts me to.. I gotta ask...

No offence but...
Don't you know what a here_doc is?

--
Dodger

2008/7/9 <adam.prime [at] utoronto>:
> A couple of months ago i was going through slides from gozers "From CGI to
> mod_perl 2.0, Fast!" talk, which has some benchmarks comparing CGI, perlrun
> and registry to each other. At which point i realized that i've never
> really known how much faster using straight handlers is than using one of
> the CGI emulation layers. I also didn't have any idea how much faster
> SetHandler modperl was vs SetHandler perl-script.
>
> So i decided to see what i could figure out. I took gozers CGI from the
> slides (slightly modified) and ran it through the paces on my laptop, then
> converted the script to run as a straight handler.
>
> here's the CGI version:
>
> #!/usr/bin/perl
>
>
> print qq[Content-Type: text/html\r\n\r\n];
>
> print(qq[.
> <html><body>
> <h1>Hello Worlds</h1>
> <pre>
> GATEWAY_INTERFACE: $ENV{GATEWAY_INTERFACE}
> MOD_PERL: $ENV{MOD_PERL}
> </pre>
> </body></html>
>
> ]);
>
>
> Here's the Handler version
>
> package Kabob::HelloWorld;
>
> use strict;
> use warnings;
>
> use Apache2::RequestRec ();
>
> use Apache2::Const -compile =>qw(:common);
>
> sub handler {
> my $r = shift;
>
> $r->content_type('text/html');
> $r->print(qq[.
> <html><body>
> <h1>Hello Worlds</h1>
> <pre>
> GATEWAY_INTERFACE: $ENV{GATEWAY_INTERFACE}
> MOD_PERL: $ENV{MOD_PERL}
> </pre>
> </body></html>
>
>
> ]);
>
> return Apache2::Const::OK;
> }
>
> 1;
>
> and here's the conf (these tests were all running through a light mod_proxy
> front end too)
>
>
> <Location /cgi/>
> <IfDefine FrontEnd>
> ProxyPass http://localhost:8080/cgi/
> ProxyPassReverse http://localhost:8080/cgi/
> </IfDefine>
> </Location>
> <IfDefine BackEnd>
> ScriptAlias /cgi/ /www/p/
> </IfDefine>
>
>
> Alias /perlrun/ /www/p/
> <Location /perlrun/>
> <IfDefine FrontEnd>
> ProxyPass http://localhost:8080/perlrun/
> ProxyPassReverse http://localhost:8080/perlrun/
> </IfDefine>
> <IfDefine BackEnd>
> SetHandler perl-script
> PerlHandler ModPerl::PerlRun
> Options +ExecCGI
> PerlSendHeader On
> </IfDefine>
> </Location>
>
> Alias /registry/ /www/p/
> <Location /registry/>
> <IfDefine FrontEnd>
> ProxyPass http://localhost:8080/registry/
> ProxyPassReverse http://localhost:8080/registry/
> </IfDefine>
> <IfDefine BackEnd>
> SetHandler perl-script
> PerlHandler ModPerl::Registry
> Options +ExecCGI
> PerlSendHeader On
> </IfDefine>
> </Location>
>
>
>
> <Location /perlscript/>
> <IfDefine FrontEnd>
> ProxyPass http://localhost:8080/perlscript/
> ProxyPassReverse http://localhost:8080/perlscript/
> </IfDefine>
> <IfDefine BackEnd>
> SetHandler perl-script
> PerlResponseHandler Kabob::HelloWorld
> </IfDefine>
> </Location>
>
> <Location /modperl/>
> <IfDefine FrontEnd>
> ProxyPass http://localhost:8080/modperl/
> ProxyPassReverse http://localhost:8080/modperl/
> </IfDefine>
> <IfDefine BackEnd>
> SetHandler modperl
> PerlResponseHandler Kabob::HelloWorld
> </IfDefine>
> </Location>
>
>
> and here's the results (which are no doubt flawed for a number of reasons)
>
> running: ab -n 10000 [url]
>
> CGI
> Requests per second: 217.80 [#/sec] (mean)
> Time per request: 4.591 [ms] (mean)
> Transfer rate: 53.17 [Kbytes/sec] received
>
> PerlRun
> Requests per second: 482.49 [#/sec] (mean)
> Time per request: 2.073 [ms] (mean)
> Transfer rate: 114.49 [Kbytes/sec] received
>
> Registry
> Requests per second: 693.33 [#/sec] (mean)
> Time per request: 1.442 [ms] (mean)
> Transfer rate: 164.53 [Kbytes/sec] received
>
> SetHandler perl-script
> Requests per second: 772.12 [#/sec] (mean)
> Time per request: 1.295 [ms] (mean)
> Transfer rate: 189.94 [Kbytes/sec] received
>
> SetHandler modperl
> Requests per second: 1048.66 [#/sec] (mean)
> Time per request: 0.954 [ms] (mean)
> Transfer rate: 250.84 [Kbytes/sec] received
>
> I'm not sure how well you can really compare the CGI emulation numbers to
> the PerlHandler numbers, but personally i think the 30%ish improvement from
> perl-script to modperl is pretty amazing. I wouldn't have imagined it would
> have been that high.
>
> Adam
>
>
>
>
>
>
>
>
>



--
Dodger


el.dodgero at gmail

Jul 10, 2008, 2:47 AM

Post #3 of 10 (1229 views)
Permalink
Re: some flawed benchmarks [In reply to]

Oh. I would also recommend three variants, based on what people often
do, what people sometimes do, and what people probably should do when
using CGI.pm, which can make a difference (just for thoroughness):

Usually done:
#!/usr/bin/perl
use CGI;
print header;

print <<"EOF";
<html>
<body>
<h1>Environment dump:</h1>
<dl>
@{[map "<dt>$_</dt>\n<dd>$ENV{$_}</dd>\n", sort keys %ENV]}
</dl>
</body>
</html>
EOF

Sometimes do:
#!/usr/bin/perl
use strict;
use CGI;
my $cgi = new CGI;
print $cgi->header;

print <<"EOF";
<html>
<body>
<h1>Environment dump:</h1>
<dl>
@{[map "<dt>$_</dt>\n<dd>$ENV{$_}</dd>\n", sort keys %ENV]}
</dl>
</body>
</html>
EOF

Might do occassionally, and probably should do all the time if using CGI:

#!/usr/bin/perl
use strict;
use CGI(); # note the difference -- using CGI in OO mode, don't import
*anything*
my $cgi = new CGI;
print $cgi->header;

print <<"EOF";
<html>
<body>
<h1>Environment dump:</h1>
<dl>
@{[map "<dt>$_</dt>\n<dd>$ENV{$_}</dd>\n", sort keys %ENV]}
</dl>
</body>
</html>
EOF

2008/7/9 <adam.prime [at] utoronto>:
> A couple of months ago i was going through slides from gozers "From CGI to
> mod_perl 2.0, Fast!" talk, which has some benchmarks comparing CGI, perlrun
> and registry to each other. At which point i realized that i've never
> really known how much faster using straight handlers is than using one of
> the CGI emulation layers. I also didn't have any idea how much faster
> SetHandler modperl was vs SetHandler perl-script.
>
> So i decided to see what i could figure out. I took gozers CGI from the
> slides (slightly modified) and ran it through the paces on my laptop, then
> converted the script to run as a straight handler.
>
> here's the CGI version:
>
> #!/usr/bin/perl
>
>
> print qq[Content-Type: text/html\r\n\r\n];
>
> print(qq[.
> <html><body>
> <h1>Hello Worlds</h1>
> <pre>
> GATEWAY_INTERFACE: $ENV{GATEWAY_INTERFACE}
> MOD_PERL: $ENV{MOD_PERL}
> </pre>
> </body></html>
>
> ]);
>
>
> Here's the Handler version
>
> package Kabob::HelloWorld;
>
> use strict;
> use warnings;
>
> use Apache2::RequestRec ();
>
> use Apache2::Const -compile =>qw(:common);
>
> sub handler {
> my $r = shift;
>
> $r->content_type('text/html');
> $r->print(qq[.
> <html><body>
> <h1>Hello Worlds</h1>
> <pre>
> GATEWAY_INTERFACE: $ENV{GATEWAY_INTERFACE}
> MOD_PERL: $ENV{MOD_PERL}
> </pre>
> </body></html>
>
>
> ]);
>
> return Apache2::Const::OK;
> }
>
> 1;
>
> and here's the conf (these tests were all running through a light mod_proxy
> front end too)
>
>
> <Location /cgi/>
> <IfDefine FrontEnd>
> ProxyPass http://localhost:8080/cgi/
> ProxyPassReverse http://localhost:8080/cgi/
> </IfDefine>
> </Location>
> <IfDefine BackEnd>
> ScriptAlias /cgi/ /www/p/
> </IfDefine>
>
>
> Alias /perlrun/ /www/p/
> <Location /perlrun/>
> <IfDefine FrontEnd>
> ProxyPass http://localhost:8080/perlrun/
> ProxyPassReverse http://localhost:8080/perlrun/
> </IfDefine>
> <IfDefine BackEnd>
> SetHandler perl-script
> PerlHandler ModPerl::PerlRun
> Options +ExecCGI
> PerlSendHeader On
> </IfDefine>
> </Location>
>
> Alias /registry/ /www/p/
> <Location /registry/>
> <IfDefine FrontEnd>
> ProxyPass http://localhost:8080/registry/
> ProxyPassReverse http://localhost:8080/registry/
> </IfDefine>
> <IfDefine BackEnd>
> SetHandler perl-script
> PerlHandler ModPerl::Registry
> Options +ExecCGI
> PerlSendHeader On
> </IfDefine>
> </Location>
>
>
>
> <Location /perlscript/>
> <IfDefine FrontEnd>
> ProxyPass http://localhost:8080/perlscript/
> ProxyPassReverse http://localhost:8080/perlscript/
> </IfDefine>
> <IfDefine BackEnd>
> SetHandler perl-script
> PerlResponseHandler Kabob::HelloWorld
> </IfDefine>
> </Location>
>
> <Location /modperl/>
> <IfDefine FrontEnd>
> ProxyPass http://localhost:8080/modperl/
> ProxyPassReverse http://localhost:8080/modperl/
> </IfDefine>
> <IfDefine BackEnd>
> SetHandler modperl
> PerlResponseHandler Kabob::HelloWorld
> </IfDefine>
> </Location>
>
>
> and here's the results (which are no doubt flawed for a number of reasons)
>
> running: ab -n 10000 [url]
>
> CGI
> Requests per second: 217.80 [#/sec] (mean)
> Time per request: 4.591 [ms] (mean)
> Transfer rate: 53.17 [Kbytes/sec] received
>
> PerlRun
> Requests per second: 482.49 [#/sec] (mean)
> Time per request: 2.073 [ms] (mean)
> Transfer rate: 114.49 [Kbytes/sec] received
>
> Registry
> Requests per second: 693.33 [#/sec] (mean)
> Time per request: 1.442 [ms] (mean)
> Transfer rate: 164.53 [Kbytes/sec] received
>
> SetHandler perl-script
> Requests per second: 772.12 [#/sec] (mean)
> Time per request: 1.295 [ms] (mean)
> Transfer rate: 189.94 [Kbytes/sec] received
>
> SetHandler modperl
> Requests per second: 1048.66 [#/sec] (mean)
> Time per request: 0.954 [ms] (mean)
> Transfer rate: 250.84 [Kbytes/sec] received
>
> I'm not sure how well you can really compare the CGI emulation numbers to
> the PerlHandler numbers, but personally i think the 30%ish improvement from
> perl-script to modperl is pretty amazing. I wouldn't have imagined it would
> have been that high.
>
> Adam
>
>
>
>
>
>
>
>
>



--
Dodger


andy at hexten

Jul 10, 2008, 2:55 AM

Post #4 of 10 (1234 views)
Permalink
Re: some flawed benchmarks [In reply to]

On 10 Jul 2008, at 06:28, adam.prime [at] utoronto wrote:
> I'm not sure how well you can really compare the CGI emulation
> numbers to the PerlHandler numbers, but personally i think the
> 30%ish improvement from perl-script to modperl is pretty amazing. I
> wouldn't have imagined it would have been that high.


It would be interesting to see how FCGI compares to those numbers.

--
Andy Armstrong, Hexten


adam.prime at utoronto

Jul 10, 2008, 5:50 AM

Post #5 of 10 (1217 views)
Permalink
Re: some flawed benchmarks [In reply to]

I deliberately removed CGI from the script because i personally would
never use CGI in something written to be run as straight handlers, and
it obviously wouldn't make any sense to use CGI in the CGI emulations,
and then not use it in the Handler version.

Not using heredoc's shouldn't really have any effect on the (already
flawed) results, because they weren't used in any of the examples. But
yeah, it was late and i should have been sleeping but i was dorking
around with this instead.

I'm personally not really interested in how using CGI affects the
numbers, but if other people would like to see them i can do this later
tonight.

Adam


Dodger wrote:
> Oh. I would also recommend three variants, based on what people often
> do, what people sometimes do, and what people probably should do when
> using CGI.pm, which can make a difference (just for thoroughness):
>
> Usually done:
> #!/usr/bin/perl
> use CGI;
> print header;
>
> print <<"EOF";
> <html>
> <body>
> <h1>Environment dump:</h1>
> <dl>
> @{[map "<dt>$_</dt>\n<dd>$ENV{$_}</dd>\n", sort keys %ENV]}
> </dl>
> </body>
> </html>
> EOF
>
> Sometimes do:
> #!/usr/bin/perl
> use strict;
> use CGI;
> my $cgi = new CGI;
> print $cgi->header;
>
> print <<"EOF";
> <html>
> <body>
> <h1>Environment dump:</h1>
> <dl>
> @{[map "<dt>$_</dt>\n<dd>$ENV{$_}</dd>\n", sort keys %ENV]}
> </dl>
> </body>
> </html>
> EOF
>
> Might do occassionally, and probably should do all the time if using CGI:
>
> #!/usr/bin/perl
> use strict;
> use CGI(); # note the difference -- using CGI in OO mode, don't import
> *anything*
> my $cgi = new CGI;
> print $cgi->header;
>
> print <<"EOF";
> <html>
> <body>
> <h1>Environment dump:</h1>
> <dl>
> @{[map "<dt>$_</dt>\n<dd>$ENV{$_}</dd>\n", sort keys %ENV]}
> </dl>
> </body>
> </html>
> EOF
>


adam.prime at utoronto

Jul 10, 2008, 5:51 AM

Post #6 of 10 (1227 views)
Permalink
Re: some flawed benchmarks [In reply to]

Andy Armstrong wrote:
> It would be interesting to see how FCGI compares to those numbers.

I don't know anything about fastcgi, but i suppose i could look at that
also this evening.

Adam


perrin at elem

Jul 10, 2008, 6:26 AM

Post #7 of 10 (1210 views)
Permalink
Re: some flawed benchmarks [In reply to]

On Thu, Jul 10, 2008 at 1:28 AM, <adam.prime [at] utoronto> wrote:
> and here's the conf (these tests were all running through a light mod_proxy
> front end too)

Note that CGI and FastCGI don't need the proxy frontend.

> I'm not sure how well you can really compare the CGI emulation numbers to
> the PerlHandler numbers, but personally i think the 30%ish improvement from
> perl-script to modperl is pretty amazing. I wouldn't have imagined it would
> have been that high.

It is pretty cool that it works so well. I feel like I should point
out though, for the benefit of those using Registry, that the
difference is only this big because the code isn't doing anything. In
a real-world scenario you'd see an improvement, but nothing close to
30%.

- Perrin


adam.prime at utoronto

Jul 10, 2008, 7:05 AM

Post #8 of 10 (1206 views)
Permalink
Re: some flawed benchmarks [In reply to]

Quoting Perrin Harkins <perrin [at] elem>:

> Note that CGI and FastCGI don't need the proxy frontend.

The only reason I did it that way was because that's how apache was
already set up on my laptop, and i didn't feel like dorking around
with it too much. I could certainly change it around so that CGI and
FGCGI (if added) were handled by the light apache. I wasn't sure how
apples to oranges that would be, but i guess in reality, people that
are running plain CGI or fast CGI probably aren't doing it on a
mod_perl enabled server.

> It is pretty cool that it works so well. I feel like I should point
> out though, for the benefit of those using Registry, that the
> difference is only this big because the code isn't doing anything. In
> a real-world scenario you'd see an improvement, but nothing close to
> 30%.

It's probably also worth noting that under sethandler modperl the
GATEWAY_INTERFACE env variable has no value, which results in the page
being 3 bytes shorter (iirc), which is actually a pretty big deal
since the whole page is pretty short. The examples should likely be
modified to actually return pages that are the same length.

anything else stupid i'm missing?

adam


adam.prime at utoronto

Jul 10, 2008, 8:43 PM

Post #9 of 10 (1193 views)
Permalink
Re: some flawed benchmarks [In reply to]

i've changed some stuff and added fastcgi to the mix. i've given
numbers through the proxy as well as without it for all the mod_perl
examples

I've modified the scripts so that they producing the same amount of
output for each example (except cgi, which adds a content-length
header, so the total data transfered is larger)

here's the cgi, used under cgi, perlrun and registry:

#!/usr/bin/perl

use strict;

print qq[Content-Type: text/html\r\n\r\n];

my $blurb = qq[1234567890\n] x 100;

print <<EOF;
<html><body>
<h1>Hello Worlds</h1>
<pre>
$blurb
</pre>
</body></html>
EOF

here's the fastcgi version:

#!/usr/bin/perl

use strict;
use FCGI;

while (FCGI::accept >= 0) {

print qq[Content-Type: text/html\r\n\r\n];

my $blurb = qq[1234567890\n] x 100;

print <<EOF;
<html><body>
<h1>Hello Worlds</h1>
<pre>
$blurb
</pre>
</body></html>
EOF

}

and here's the handler, used for perlscript and modperl:

package Kabob::HelloWorld;

use strict;

use Apache2::RequestRec ();
use Apache2::Const -compile =>qw(:common);

sub handler {
my $r = shift;

$r->content_type('text/html');

my $blurb = qq[1234567890\n] x 100;

$r->print(<<EOF);
<html><body>
<h1>Hello Worlds</h1>
<pre>
$blurb
</pre>
</body></html>
EOF

return Apache2::Const::OK;
}

1;


This is the conf entry for fast-cgi

Alias /fcgi/ /www/p/
<Location /fcgi/>
<IfDefine FrontEnd>
SetHandler fastcgi-script
Options +ExecCGI
</IfDefine>
</Location>

the conf entries for the other examples remained the same as they were
in the original email. Obviously i didn't get to the different
methods of CGI that dodger suggested. maybe over the weekend.

results ordered by transfer rate:

cgi - no proxy
Total transferred: 13080000 bytes
HTML transferred: 11640000 bytes
Requests per second: 95.58 [#/sec] (mean)
Time per request: 10.462 [ms] (mean)
Transfer rate: 122.09 [Kbytes/sec] received

perlrun - through proxy
Total transferred: 12860000 bytes
HTML transferred: 11640000 bytes
Requests per second: 463.07 [#/sec] (mean)
Time per request: 2.160 [ms] (mean)
Transfer rate: 581.52 [Kbytes/sec] received

registry - through proxy
Total transferred: 12860000 bytes
HTML transferred: 11640000 bytes
Requests per second: 641.11 [#/sec] (mean)
Time per request: 1.560 [ms] (mean)
Transfer rate: 805.10 [Kbytes/sec] received

perlrun - no proxy
Total transferred: 12860000 bytes
HTML transferred: 11640000 bytes
Requests per second: 658.17 [#/sec] (mean)
Time per request: 1.519 [ms] (mean)
Transfer rate: 826.53 [Kbytes/sec] received

perlscript - through proxy
Total transferred: 12860000 bytes
HTML transferred: 11640000 bytes
Requests per second: 788.59 [#/sec] (mean)
Time per request: 1.268 [ms] (mean)
Transfer rate: 990.31 [Kbytes/sec] received

modperl - through proxy
Total transferred: 12860000 bytes
HTML transferred: 11640000 bytes
Requests per second: 1063.74 [#/sec] (mean)
Time per request: 0.940 [ms] (mean)
Transfer rate: 1335.84 [Kbytes/sec] received

registry - no proxy
Total transferred: 12860000 bytes
HTML transferred: 11640000 bytes
Requests per second: 1160.28 [#/sec] (mean)
Time per request: 0.862 [ms] (mean)
Transfer rate: 1457.08 [Kbytes/sec] received

fastcgi - no proxy
Total transferred: 12860000 bytes
HTML transferred: 11640000 bytes
Requests per second: 1201.28 [#/sec] (mean)
Time per request: 0.832 [ms] (mean)
Transfer rate: 1508.57 [Kbytes/sec] received

perlscript - no proxy
Total transferred: 12860000 bytes
HTML transferred: 11640000 bytes
Requests per second: 1430.31 [#/sec] (mean)
Time per request: 0.699 [ms] (mean)
Transfer rate: 1796.18 [Kbytes/sec] received

modperl - no proxy
Total transferred: 12860000 bytes
HTML transferred: 11640000 bytes
Requests per second: 2430.80 [#/sec] (mean)
Time per request: 0.411 [ms] (mean)
Transfer rate: 3052.59 [Kbytes/sec] received

With the proxy taken out of the mix, the jump from perlscript to
modperl is even more pronounced.

If anyone's got any ideas about why the proxy is having as significant
an impact as it is, i'd love to tweak it. Also worth noting is that
the front end is running worker, the backend is running prefork.

adam


perrin at elem

Jul 10, 2008, 9:12 PM

Post #10 of 10 (1202 views)
Permalink
Re: some flawed benchmarks [In reply to]

On Thu, Jul 10, 2008 at 11:43 PM, <adam.prime [at] utoronto> wrote:
> If anyone's got any ideas about why the proxy is having as significant an
> impact as it is, i'd love to tweak it.

There are some proxy settings in recent mod_proxy versions (apache
2.2) which you could experiment with. I haven't tried them yet. I
think you can use persistent connections to the backend with this
setup, since it can pool them with the worker MPM.

You could also experiment with the config on the mod_perl server. For
the most part, if you run with concurrency below MaxClients and you do
a warmup run before each benchmark, it should mitigate common config
issues.

> Also worth noting is that the front
> end is running worker, the backend is running prefork.

That's a good setup. Some people use lighttpd, perlbal, nginx, etc.
for proxying. If you feel ambitious you could try one of those.

- Perrin

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.