Hey all! I’m getting ready to launch my new MODx-ified website which normally receives a moderate amount of traffic. I decided to benchmark the main page with AB, just to see how it compares to the current incarnation of my site. I was expecting a reasonable decrease in performance because of increased database usage, additional PHP execution, and simply the overhead of using a CMS to manage my content. But in my case when running AB and comparing the MODx-ified site to my current site (some PHP and DB content), performance is decreased by 75-80%!
AB was run with a concurrency of 5, and a total of 3000 requests.
MODx Site:
Completed 300 requests
Completed 600 requests
Completed 900 requests
Completed 1200 requests
Completed 1500 requests
Completed 1800 requests
Completed 2100 requests
Completed 2400 requests
Completed 2700 requests
Finished 3000 requests
Server Software: Apache
Server Hostname: <domain.tld>
Server Port: 80
Document Path: /
Document Length: 21459 bytes
Concurrency Level: 5
Time taken for tests: 45.908146 seconds
Complete requests: 3000
Failed requests: 47
(Connect: 0, Length: 47, Exceptions: 0)
Write errors: 0
Total transferred: 65062087 bytes
HTML transferred: 63861667 bytes
Requests per second: 65.35 [#/sec] (mean)
Time per request: 76.514 [ms] (mean)
Time per request: 15.303 [ms] (mean, across all concurrent requests)
Transfer rate: 1384.00 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 37 75 34.7 73 770
Waiting: 0 70 35.3 68 765
Total: 37 75 34.7 73 770
Percentage of the requests served within a certain time (ms)
50% 73
66% 74
75% 75
80% 75
90% 78
95% 81
98% 85
99% 148
100% 770 (longest request)
Current (non-MODx) Site:
Completed 300 requests
Completed 600 requests
Completed 900 requests
Completed 1200 requests
Completed 1500 requests
Completed 1800 requests
Completed 2100 requests
Completed 2400 requests
Completed 2700 requests
Finished 3000 requests
Server Software: Apache
Server Hostname: <domain.tld>
Server Port: 80
Document Path: /
Document Length: 90667 bytes
Concurrency Level: 5
Time taken for tests: 8.835535 seconds
Complete requests: 3000
Failed requests: 0
Write errors: 0
Total transferred: 272451000 bytes
HTML transferred: 272001000 bytes
Requests per second: 339.54 [#/sec] (mean)
Time per request: 14.726 [ms] (mean)
Time per request: 2.945 [ms] (mean, across all concurrent requests)
Transfer rate: 30113.06 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 3
Processing: 7 14 2.9 14 62
Waiting: 1 4 1.7 4 20
Total: 7 14 2.9 14 62
Percentage of the requests served within a certain time (ms)
50% 14
66% 15
75% 16
80% 16
90% 17
95% 19
98% 21
99% 22
100% 62 (longest request)
Now, my MODx site has around 1,300 total Resources, so I tested a completely vanilla install. No addons, no new resources - just the base traditional 2.0.6-pl release.
Completed 300 requests
Completed 600 requests
Completed 900 requests
Completed 1200 requests
Completed 1500 requests
Completed 1800 requests
Completed 2100 requests
Completed 2400 requests
Completed 2700 requests
Finished 3000 requests
Server Software: Apache
Server Hostname: <domain.tld>
Server Port: 80
Document Path: /
Document Length: 131 bytes
Concurrency Level: 5
Time taken for tests: 25.606648 seconds
Complete requests: 3000
Failed requests: 12
(Connect: 0, Length: 12, Exceptions: 0)
Write errors: 0
Total transferred: 1664316 bytes
HTML transferred: 391428 bytes
Requests per second: 117.16 [#/sec] (mean)
Time per request: 42.678 [ms] (mean)
Time per request: 8.536 [ms] (mean, across all concurrent requests)
Transfer rate: 63.46 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 32 42 10.6 41 236
Waiting: 0 41 9.7 41 236
Total: 32 42 10.6 41 236
Percentage of the requests served within a certain time (ms)
50% 41
66% 42
75% 42
80% 43
90% 44
95% 46
98% 49
99% 53
100% 236 (longest request)
As you can see, the vanilla MODx install fared better than my site loaded with content, but it’s the performance is still 33% of my current mostly-static site.
I’m concerned that with the amount of traffic my site gets, and the results of these benchmarks, that the performance of my site is going to be decreased considerably. I’ve cached all resources and snippet calls (well, most - except for things that absolutely must be uncached, which are very few - only one on my main page).
Server stats:
PHP 5.3.4
MySQL 5.0.91
Apache 2.2.17
APC 3.1.6
4GB RAM
2x Xeon Harpertown CPUs @ 2.66GHz
One other thing - when running the benchmark on either MODx site, I’m seeing failed requests by AB. Those requests are accompanied by the following error in the apache error_log:
[notice] child pid 22736 exit signal Bus error (7)
And a number of these messages show up in the MODx error log:
No class specified for loadClass
I wonder if MODx could be crashing under high loads?