Question
I'm trying to use
ModPerl to improve performance on a test server which is soon to become our new production server. It's running stock
Fedora Core 2
.
However, the performance improvement I get is non-existent; 0.35 requests per second against 0.38 request per second for vanilla CGI - not very spectacular.
With
ModPerl handling:
[root@cobbit bin]# ab -n 10 http://localhost/twiki/bin/view/TWiki/WebHome
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.7 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
...
Concurrency Level: 1
Time taken for tests: 28.774962 seconds
Complete requests: 10
Failed requests: 0
Write errors: 0
Total transferred: 430800 bytes
HTML transferred: 429280 bytes
Requests per second: 0.35 [#/sec] (mean)
Time per request: 2877.496 [ms] (mean)
Time per request: 2877.496 [ms] (mean, across all concurrent requests)
Transfer rate: 14.60 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 2180 2876 358.2 3045 3073
Waiting: 2179 2875 358.3 3043 3071
Total: 2180 2876 358.2 3045 3073
Without
ModPerl :
[root@cobbit bin]# ab -n 10 http://localhost/twiki/bin/view/TWiki/WebHome
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.7 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
Concurrency Level: 1
Time taken for tests: 26.630392 seconds
Complete requests: 10
Failed requests: 0
Write errors: 0
Total transferred: 430800 bytes
HTML transferred: 429280 bytes
Requests per second: 0.38 [#/sec] (mean)
Time per request: 2663.039 [ms] (mean)
Time per request: 2663.039 [ms] (mean, across all concurrent requests)
Transfer rate: 15.77 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 2649 2662 7.6 2666 2672
Waiting: 2634 2647 7.8 2651 2658
Total: 2649 2662 7.6 2666 2672
The machine itself is a dual PIII-733 with a SCSI disk subsystem so I'd expect better: back in 2001,
JohnLehmann reported figures of 28.81 requests per second.
Environment
testenv reports that mod_perl is being used to serve the page:
mod_perl: Used for this script (mod_perl not loaded into Apache) - mod_perl version 1.9912
twiki/bin/.htaccess has
<Files *>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
Options ExecCGI
PerlOptions +ParseHeaders
</Files>
/etc/httpd/conf.d/perl.conf contains
LoadModule perl_module modules/mod_perl.so
PerlTaintCheck On
PerlRequire /etc/httpd/conf/startup.pl
and
/etc/httpd/conf/startup.pl contains
#!/usr/bin/perl -wT
unshift @INC, '/var/www/twiki/bin';
--
GarethEdwards - 07 Jun 2004
Answer
Not an answer, a suggestion; give up fighting with
mod_perl and use
SpeedyCGI instead. It's almost as fast - see benchmarks in
ModPerlAlternatives.
--
CrawfordCurrie - 16 Jun 2004
I am having the exact same problem with Fedora Core 1. I tried using
SpeedyCGI, and that didn't seem to help either.
--
JeffHedlund - 29 Jun 2004
wow. I thought I'd do a comparison - I get 1.54 requests per second on a P4 3GHz with 1Gig Ram (500Meg worth of topics), not good - but way better than what my old server had. What else does your machine do? (our old one also was an nfs server so the twikitopics kept being uncached, while now its all from memory)
(my stat is with the pattern skin and css topics turned on, (plain skin = 2 requests per sec) (twiki skin = 1.8)
I intend to work primarly on profiling and optimising for Dakar (and to get it our quickly) but this is probly little help to you right now.
--
SvenDowideit - 30 Jun 2004
A quick testenv comment: I've never seen testenv generate the 'used but not loaded' output above, and in theory this should be impossible. Either this is a testenv bug, or your mod_perl setup has some weirdness. Being able to do the mod_perl version check within testenv implies it is working, but it really looks like mod_perl is not enabled properly given your performance stats.
Using mod_perl on Apache 2.0 is a bit unusual since that version of mod_perl is not fully sorted out, as I understand it
--
RichardDonkin - 07 Jul 2004
If you get this error message:
Can't locate object method "boot" via package "mod_perl" at ...
Try adding this line to the
startup.pl file:
use lib '/usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi';
That did the trick for me.
--
BrunoNavert - 14 Feb 2005