Jani Tarvainen, Homepage

Apache benchmarking with Wordpress, eAccelerator, WP-Cache, mod_rewrite

This document contains some performance tests done out of curiosity to gain more knowledge about web server performance. The benchmarks compare performance using Siege (version 2.6.1), Wordpress blog CMS (version 1.5.2), WP-Cache plugin for WP (version 2.0), eAccelerator PHP-accelerator module (version 0.9.3) and mod_rewrite Apache module (Apache 1.3.33).

NOTES ABOUT WORDPRESS: Wordpress is not exactly praised for performance. It can be improved with custom front-ends such as Lightpress. I used WP-Cache as the only web cache (PHP -> static files), but there are other options such as Staticize Reloaded. Feel free to do your own cache benchmarks on that (I doubt the point, though :).

Basic server setup

NOTES ABOUT SERVER SETUP: I do not have any benchmark data, but to my experience CGI-PHP has significantly worse performance under high loads (each request launches a new process). There is little difference with random page loads, though. PHP-accelerators are not supported when PHP is ran as CGI.

About the benchmarks (and methods used)

NOTES ABOUT BENCHMARKS: Wordpress can use mod_rewrite to make URLs nicer (/path/to/page/ vs. ?page_id=123). The benchmarked page is the front page, so mod_rewrite can be switched on and off without any effect to the benchmarked page itself.

Results

I’ll let you make your own conclusions based on the numbers, but here’s the quick roundup:

setup hits within 30 second (without mod_rewrite) extra
No cache, no accelerator 173 183  
WP-Cache, no accelerator 2574 5863  
No cache, eAccelerator 550 633  
WP-Cache, eAccelerator 3654 16399  
Static HTML 4343 52418 46831 *)

*) ADDITIONAL TEST: Performance improved significantly when rewrite rules were moved from .htaccess to apache config. Mad props to my man Partner for the suggestion.


No cache, no accelerator

Transactions:                    173 hits
Availability:                 100.00 %
Elapsed time:                  30.08 secs
Data transferred:            1228336 bytes
Response time:                  3.00 secs
Transaction rate:               5.75 trans/sec
Throughput:                 40835.64 bytes/sec
Concurrency:                   17.28
Successful transactions:         173
Failed transactions:               0
Longest transaction:            4.65
Shortest transaction:           0.25

mod_rewrite disabled

Transactions:                    183 hits
Availability:                 100.00 %
Elapsed time:                  29.65 secs
Data transferred:            1298329 bytes
Response time:                  2.87 secs
Transaction rate:               6.17 trans/sec
Throughput:                 43788.50 bytes/sec
Concurrency:                   17.70
Successful transactions:         183
Failed transactions:               0
Longest transaction:            4.41
Shortest transaction:           0.41

WP-Cache, no accelerator

Transactions:                   2574 hits
Availability:                 100.00 %
Elapsed time:                  29.78 secs
Data transferred:           18501824 bytes
Response time:                  0.21 secs
Transaction rate:              86.43 trans/sec
Throughput:                621283.53 bytes/sec
Concurrency:                   18.20
Successful transactions:        2574
Failed transactions:               0
Longest transaction:            1.04
Shortest transaction:           0.01

mod_rewrite disabled

Transactions:                   5863 hits
Availability:                 100.00 %
Elapsed time:                  29.90 secs
Data transferred:           42119708 bytes
Response time:                  0.09 secs
Transaction rate:             196.09 trans/sec
Throughput:               1408685.90 bytes/sec
Concurrency:                   17.85
Successful transactions:        5863
Failed transactions:               0
Longest transaction:            1.12
Shortest transaction:           0.00

No cache, eAccelerator

Transactions:                    550 hits
Availability:                 100.00 %
Elapsed time:                  30.45 secs
Data transferred:            3904516 bytes
Response time:                  1.00 secs
Transaction rate:              18.06 trans/sec
Throughput:                128227.12 bytes/sec
Concurrency:                   18.13
Successful transactions:         550
Failed transactions:               0
Longest transaction:            3.00
Shortest transaction:           0.05

mod_rewrite disabled

Transactions:                    633 hits
Availability:                 100.00 %
Elapsed time:                  30.53 secs
Data transferred:            4489488 bytes
Response time:                  0.87 secs
Transaction rate:              20.73 trans/sec
Throughput:                147051.68 bytes/sec
Concurrency:                   18.00
Successful transactions:         633
Failed transactions:               0
Longest transaction:            2.31
Shortest transaction:           0.04

WP-Cache, eAccelerator

Transactions:                   3654 hits
Availability:                 100.00 %
Elapsed time:                  30.27 secs
Data transferred:           26728970 bytes
Response time:                  0.15 secs
Transaction rate:             120.71 trans/sec
Throughput:                883018.49 bytes/sec
Concurrency:                   18.13
Successful transactions:        3654
Failed transactions:               0
Longest transaction:            0.63
Shortest transaction:           0.00

mod_rewrite disabled

Transactions:                  16399 hits
Availability:                 100.00 %
Elapsed time:                  30.06 secs
Data transferred:          117744780 bytes
Response time:                  0.03 secs
Transaction rate:             545.54 trans/sec
Throughput:               3916992.09 bytes/sec
Concurrency:                   18.22
Successful transactions:       16399
Failed transactions:               0
Longest transaction:            0.40
Shortest transaction:           0.00

Static HTML

Transactions:                   4343 hits
Availability:                 100.00 %
Elapsed time:                  29.99 secs
Data transferred:           31095880 bytes
Response time:                  0.12 secs
Transaction rate:             144.81 trans/sec
Throughput:               1036874.97 bytes/sec
Concurrency:                   17.76
Successful transactions:        4343
Failed transactions:               0
Longest transaction:            0.76
Shortest transaction:           0.00

mod_rewrite disabled

Transactions:                  52418 hits
Availability:                 100.00 %
Elapsed time:                  30.19 secs
Data transferred:          375312880 bytes
Response time:                  0.01 secs
Transaction rate:            1736.27 trans/sec
Throughput:              12431695.04 bytes/sec
Concurrency:                   18.88
Successful transactions:       52418
Failed transactions:               0
Longest transaction:            0.23
Shortest transaction:           0.00

rewrite rules moved from .htaccess to config file

Transactions:                  46831 hits
Availability:                 100.00 %
Elapsed time:                  29.98 secs
Data transferred:          335309960 bytes
Response time:                  0.01 secs
Transaction rate:            1562.07 trans/sec
Throughput:              11184455.14 bytes/sec
Concurrency:                   19.10
Successful transactions:       46831
Failed transactions:               0
Longest transaction:            0.13
Shortest transaction:           0.00