Monday, October 27, 2008

Benchmarking Zend Platform, APC and Xdebug

Introduction

Thanks to AUSY, I had the occasion to learn thoroughly the Zend Platform during a workshop. One thing I had to test is the performance impact of such platform and comparing this to some of their free software counterparts like Xdebug and APC respectively for debugging and bytecode caching.

Making of

The benchmark has been realized on an Intel® Core™2 Duo CPU T7500 @ 2.20GHz with 2Gb of RAM running Gentoo with a 2.6.25-r7 linux kernel.
ab, the Apache Benchmark tool, has been used for the benchmark with 3000 requests and three concurrency modes: -c1, -c5 and -c50 which represents respectively 1, 5 and 50 simultaneous users.
The application tested is eZ Publish 4.0.1 with default configuration using the "plain_site" example.
Different scenarios have been tested:
  • PHP: plain version of PHP 5.2.6 as released by Gentoo, this is the base that is used in the other scenarios
  • PHP+APC: base PHP + APC as released under Gentoo with default configuration
  • PHP+APC-stat: base PHP + APC as released under Gentoo with apc.stat="0"
  • PHP+APC+Xdebug: base PHP + APC + Xdebug as released under Gentoo with default configuration
  • PHP+Xdebug: base PHP + Xdebug as released under Gentoo with default configuration
  • PHP+ZP-accel: base PHP + Zend Platform without acceleration (bytecode caching)
  • PHP+ZP+accel: base PHP + Zend Platform with acceleration (bytecode caching)
  • PHP+ZP+accel(extreme): base PHP + Zend Platform with acceleration (bytecode caching) configured with "extreme" performance

The results

Enough speaking, here are the results (in requests/second served):
PHPPHP+APCPHP+APC-statPHP+APC+XdebugPHP+XdebugPHP+ZP-accelPHP+ZP+accelPHP+ZP+accel(extreme)
-c17.3036.8836.7422.505.922.7911.1831.24
-c514.4163.0265.4942.0912.604.5621.5357.35
-c5014.5064.6664.8540.6512.474.5521.2654.59
Click on the next picture for a full size graph:

Conclusions

As expected, the usage of Xdebug and especially the Zend Platform both without a bytecode cache will dramatically decrease the performance of your system. If you are a Zend Platform user, be sure to activate the bytecode cache (Zend Accelerator)! If performance is your primary concern, then choose APC, it is much faster than Zend Accelerator even in extreme mode which I don't recommend because it will disable all the real benefit you can take of the Zend Platform!

5 comments:

ReneL said...

Did you try if the APC Optimizer would give some performance boosts?
http://pecl.php.net/package/optimizer

Anonymous said...

Too bad eAccelerator was left out of the comparison.

Patrick Allaert said...

@ReneL: I tested it, but not in the scope of this article. AFAIR, it did affect the performance but with a negative impact, probably due to a debug compilation. The optimizer is way to alpha to make any conclusion.

@anonymous: the scope of this article was not to compare all PHP bytecode cache but rather comparing proprietary and FOSS PHP components and the impact of their combination. I consider that APC has a greater future than eAccelerator (that I used before), it will come with PHP 6 by default and will replace the Zend Accelerator in the Zend Platform in the future.

Gauthier Delamarre said...

Hi Patrick,

and will replace the Zend Accelerator in the Zend Platform in the future

not sure about that... actually, the Platform follower, Zend Server, offers its op-code cache for free in an extension called "Zend Optimizer +" But I don't think it's based on APC.

By the way, you could update your benchmark with this new version (available in beta version on forums.zend.com) - could be really interesting ;)

Shopping Cart said...

I think the Patrick Allaert's Blog have a complete information about to the Zend Platform.In my point his useful information are especially for web developers,Because in which the writer should discuses and Anallise the PHP.