[CLUG] simple Perl tests
Donncha O Caoimh
donncha.ocaoimh at tradesignals.com
Fri Jan 14 10:40:54 GMT 2000
After installing RH61 on a new box yesterday along with apache and
mod_perl I decided to test cgi-bin vs mod_perl again.. here are the
results:
the perl file, t.pl was:
--------------------t.pl-------------------
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html><body bgcolor=\"#ff5050\">";
print "this is a test";
-------------------------------------------
I called it 10000 times, using 300 concurrent connections to a stock
Redhat installation of Apache (I didn't change the number of Apache
children or tune it in any way).
cgi-bin:
The load on the machine went up to 73.26 and the tests took 53 seconds.
Out of the 10000 requests, 4471 failed. It did 185.36 requests per
second, and transfered 87.68 kb/s.
Mod_perl:
The load on the machine went to 5.9 and the tests took 35 seconds. All
requests completed.
It did 285.19 requests per second, and transfered 61.32 kb/s.
PHP3:
As a comparision, I created the same script in php3.
The load on the machine went up to 18.69 and the tests took 35 seconds.
All requests completed. It did 284.62 requests per second, and
transfered 61.20 kb/s.
Notes:
Perl on its own has always been known as a dog under heavy loads as the
perl interpreter has to be loaded on every request.
mod_perl has always impressed speed wise.
PHP3 is very fast, but not up to mod_perl speeds. PHP4 is supposed to be
much faster.
The tests were carried out over a 100Mbit switched LAN, the server is a
PIII500 with 256MB RAM, with an IDE disk.
Don't trust benchmarks :)
There you go, choice is a wonderful thing. I'll still code a web
application in PHP but for stuff that gets a heavy pounding I'd look
seriously at mod_perl.
Donncha.
PS. recording this for my own benefit as well..
More information about the Cork
mailing list