Benchmarking Apache Revisited

Many years ago (6? 7?) I originally conducted some simple http benchmarks to determine just how performance varied when conducting some simple tests with Apache. The page was referenced by slashdot, and has had a steady trickle of traffic ever sense. Well, given how much more powerful computers are these days, I have decided to run the benchmarks again.

Test platform

These tests were conducted in two ways. First, via the loopback interface, to compare to the previous benchmarks. Second, over a quiet, switched gigabit network. The server is an Athlon64 3200+ and the client is a nearly identical Athlon64 2800+. Both are outfitted with Intel Ethernet Express Pro 1000 networking cards.

The previous testbed was a P3 500MHz system, tested only over the loopback adapter (I was a poor college student at the time, what can I say).

Operating systems tested

The server in this benchmark was running Red Hat Enterprise Linux 4 (32bit mode). The client is running Ubuntu Linux 5.04 in 64bit mode. The server is running the 2.6.9-5.0.5.EL kernel, and the client is running 2.6.10-7. The server is running Apache httpd 2.0.52-9.ent and mod_perl-1.99_16-4 with perl 5.8.5-12.1.

The previous testbed ran on a Linux 2.2.10 based system (initially a Redhat 6.0 system, later upgraded to 2.2.10) and on a FreeBSD 3.2 based system (initially a 3.1 installation upgraded to 3.2). The tests were conducted on both platforms with a dynamically linked libperl.so. The software used was Perl 5.00503, Apache 1.3.6, and mod_perl 1.21.

Methodology

The tests were conducted with two scripts, one for the client and one for the server. The benchmark was run three times and the results from the third run is what appears below.

The tests

The following URLs were tested.

URLHandler
http://HOST/test.htmlFlat html
http://HOST/mp/mod_perl handler
http://HOST/cgi-bin/benchC CGI executable
http://HOST/cgi-bin/bench.cgiPerl CGI script

Results

URLModern (gigabit)Modern (loopback)Ancient
http://HOST/index.html6776.42 requests/second2997.10 requests/second996.41 requests/second
http://HOST/mp/2829.91 requests/second2517.12 requests/second518.24 requests/second
http://HOST/cgi-bin/bench747.44 requests/second738/50 requests/second210.19 requests/second
http://HOST/cgi-bin/bench.cgi27.23 requests/second27.45 requests/second7.22 requests/second

What have we learned?

First is that apache is fast. Very fast. Although mod_perl was used here, similar speeds are quite likely with php, mod_python, and pure C handlers (the latter being the fastest of all).

Second is that the loopback adapter is slower than gigabit (in this configuration). At first this seems odd -- loopback involves no network or hardware at all! But this is actually an expected result. The loopback interface is not tuned or optimized for this kind of small traffic (nor really for any traffic; it is hardly expected to be a performance-critical network interface).

Third is that although the CPU in question is merely four times as fast in terms of MHz rating (the Athlon64 3200+ runs at 2000MHz), it performed 5-6 times faster, which is pleasantly surprising given how network bound this type of application is. Of course, the 2.6 kernel is also significantly more advanced than its 2.2 predecessor, and likewise Apache 2 has been improved as well. It all adds up.

Disclaimer

These benchmarks are not scientific. Attempts were made to provide a stable testing environment, but this is just testing five similar URLs. This is more akin to a a salt-flats test than to a triathlon and should not be construed as what you would expect from a regular web server. But, hey, it's interesting data, particularly given the historical context!