Category Archives: Projects

APC MediaWiki Performance Optimization

Using APC (Alternative PHP Cache) to speed up a slow MediaWiki install is a good idea. A quick before and after study of the performance gain from APC using Apache ab resulted in pages being served 4 times faster (from 328ms mean load time to 82ms, number of pages loaded in 20 seconds went from 123 to 485).

APC MediaWiki Optimization Details

Before APC (Alternative PHP Cache) this was an Apache ab benchmark with the MyErasmus.org Erasmus Program Wiki on a local test server:

This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking myerasmus.org (be patient)
Finished 123 requests

Server Software: Apache
Server Hostname: myerasmus.org
Server Port: 80

Document Path: /wiki/Main_Page/
Document Length: 9949 bytes

Concurrency Level: 2
Time taken for tests: 20.165579 seconds
Complete requests: 123
Failed requests: 0
Write errors: 0
Keep-Alive requests: 0
Total transferred: 1260448 bytes
HTML transferred: 1226348 bytes
Requests per second: 6.10 [#/sec] (mean)
Time per request: 327.896 [ms] (mean)
Time per request: 163.948 [ms] (mean, across all concurrent requests)
Transfer rate: 61.00 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.9 0 10
Processing: 151 323 170.7 308 1515
Waiting: 140 303 164.7 289 1506
Total: 151 323 170.7 308 1515

Percentage of the requests served within a certain time (ms)
50% 308
66% 329
75% 348
80% 363
90% 396
95% 466
98% 696
99% 1369
100% 1515 (longest request)

This is the performance on the Erasmus Program Wiki after APC was installed and enabled:

This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking myerasmus.org (be patient)
Finished 485 requests

Server Software: Apache
Server Hostname: myerasmus.org
Server Port: 80

Document Path: /wiki/Main_Page/
Document Length: 9949 bytes

Concurrency Level: 2
Time taken for tests: 20.1082 seconds
Complete requests: 485
Failed requests: 0
Write errors: 0
Keep-Alive requests: 0
Total transferred: 4958640 bytes
HTML transferred: 4825265 bytes
Requests per second: 24.25 [#/sec] (mean)
Time per request: 82.479 [ms] (mean)
Time per request: 41.239 [ms] (mean, across all concurrent requests)
Transfer rate: 242.09 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.0 0 10
Processing: 38 81 197.5 41 3070
Waiting: 35 78 197.3 38 3057
Total: 38 81 197.5 42 3070

Percentage of the requests served within a certain time (ms)
50% 42
66% 77
75% 80
80% 80
90% 88
95% 99
98% 351
99% 1087
100% 3070 (longest request)

Needless to say, a 400% improvement in performance for serving a MediaWiki multi-language pooled resource site, simply by installing APC to cache PHP intermediate code, is a very welcome change. Not to mention the easing of CPU and IO resources on our Xen virtualized Ubuntu 6.06 server so that there are more cycles to spare for other processes (like Ruby and Ruby on Rails).

InstallingCats.com

From its beginning of instructing others how to dual boot their Mac with Tiger and Leopard, InstallingCats.com has grown into a troubleshooting and solutions website for various Mac issues and applications.
The most popular articles include

ic_screenshot