APC
Alternative PHP Cache, will be included in the core of PHP 6.
XCache
Developed by one of the developers of Lighttpd.
Benchmarks where done on a small Amazon EC2 instance, running official Ubuntu 9.10 image. Benchmarks where done on two different occasions, average results are used. The following packages are installed from APT.
- libapache2-mod-php5
- php5-mysql
- php-apc
- php5-xcache
- mysql-server
The following web sites will be tested
- Hello World script
- WordPress 2.9.1
- Joomla 1.5.15
Benchmarking itself is done with ab (Apache benchmarking tool) on localhost, doing 1000 requests over 10 connections (-n 1000 -c 10). Interesting numbers are request per second.
Here’s the results, numbers are requests per second, the percent is the improvement.
| Without accelerator | With APC | With XCache | |
| Hello World | 1499 | 1602 (7%) | 1563 (4%) |
| WordPress | 2,82 | 12,61 (347%) | 12,97 (360%) |
| Joomla | 2,25 | 3,60 (60%) | 3,48 (55%) |
The big increase in WordPress performance could be because not much sample data is installed in the default installation (compared to the option in the Joomla install, which i used), which could mean that the large bottleneck in Joomla is MySQL not PHP, while being the other way around for WordPress. But even with large amount of data, the performance improvement should be good.
Conclusion
Since there isn’t any big difference in performance between the two, I would choose APC. Mainly because it will be included in the core of PHP 6.
