发新话题
打印

PHP Accelerators

PHP Accelerators

http://www.ducea.com/2006/10/30/php-accelerators/

PHP Accelerators/Cachers will boost the performance of your PHPapplications, by caching the compiled form of php scripts to avoid theoverhead of parsing and compiling the code every time the page isloaded. A PHP accelerator typically reduces server load and increasesthe speed of your PHP code by 1-10 times. Normally you will installthese in the form of a php extension.

This list contains all the php accelerator solutions available atthis time, with a short description and some personal notes. Whenchoosing a php accelerator for your site, you should evaluate:
- evaluate the speed improvement. Normally any php applicationwill gain at least 100% in speed only by installing any phpaccelerator, but you should do your own benchmark to see if it isuseful or not.
- look for any problems caused by this. Your application mightbreak or crash randomly after installing a php accelerator. The currentsolutions look pretty stable, but still this might happen.
Enough with the introduction… here we go (in alphabetic order…):

1. APC (Alternative PHP Cache) - http://pecl.php.net/package/APC
“APC is a free, open, and robust framework for caching and optimizing PHP intermediate code.”
Latest stable version: 3.0.12p2 (2006-09-05)
Download link: http://pecl.php.net/package/APC
Official installation help: inside the source
MyOpinion: recommended:
- stable
- works with all PHP versions including PHP5.1
- actively maintained

2. eAccelerator - http://eaccelerator.net/
“eAccelerator was born in December 2004 as a fork of the TurckMMCache project. Turck MMCache was created by Dmitry Stogov and much ofthe eAccelerator code is still based on his work. eAccelerator alsocontains a PHP encoder and loader. The latest release, 0.9.5, supportsPHP 4 and all PHP 5 releases including 5.2. In older releases, theencoder will only work with PHP versions from the 4.x.x branch.eAccelerator will not work with any other versions of PHP.”
Latest stable version: 0.9.5 (2006-10-11)
Download link: http://bart.eaccelerator.net/source/0.9.5/
Official installation help: http://eaccelerator.net/wiki/InstallFromSource
MyOpinion: recommended:
- the latest version 0.9.5 works fine with PHP5.1
- actively maintained
- very good performance

3. XCache - http://trac.lighttpd.net/xcache/
“XCache is a fast, stable PHP opcode cacher that has been testedand is now running on production servers under high load. It is tested(on linux) and supported on all of the latest PHP cvs branches such asPHP_4_3 PHP_4_4 PHP_5_0 PHP_5_1 PHP_5_2 HEAD(6.x). ThreadSafe/Windowsis also supported. It overcomes a lot of problems that has been withother competing opcachers such as being able to be used with new PHPversions.”
Latest stable version: 1.0.3-rc1 (2006-10-11)
Download link: http://210.51.190.228/pub/XCache/rc/1.0.3-rc1/
Official installation help: http://trac.lighttpd.net/xcache/wiki/InstallFromSource
MyOpinion: looks very interesting
- new kid on the block developed by mOo who is also a developer of Lighttpd.
- actively maintained (different releases stable/unstable/devel)
- many interesting features
- developed to overcome some of the limitations of the existing solutions at that time.

Others (commercial/discontinued, etc):

Zend Optimizer - http://www.zend.com/products/zend_optimizer
MyOpinion: closed source, not really an optimizer (normally youwill not see a real performance improvement from this)… useful only forthe encoder if needed by some commercial scripts.
Zend Platform - http://www.zend.com/products/zend_platform
MyOpinion: commercial product; more than an optimizer that has features that serious developers might find useful.
ionCube PHP Accelerator (PHPA) - http://www.php-accelerator.co.uk/
MyOpinion: discontinued, closed source.
Turck MMCache - http://turck-mmcache.sourceforge.net/index_old.html
MyOpinion: this was a great product and many peoples still use iteven though it is now discontinued. The natural upgrade for newerversions of php is eAccelerator.

Conclusion: APC, eAccelerator and XCache are all great solutionsthat can speed up any php application. There are many benchmarks on theinternet showing how one or the other is better, but I would suggestrunning your own tests and finding the one that fits best for yourapplication.
From my experience their performance is very similar, and my personalfavorite is eAccelerator, even though I have used APC for some projectsalso. At this time I am evaluating and testing XCache and the initialresults look very good.
Keep in mind when you are installing a php accelerator that thisis not the end of your php tunings and optimizations and you shouldlook into optimizing the real application. The opcache is a niceaddition that can quickly speed up your application but don’t forgetabout the application itself. You will be surprised that in real lifethe biggest improvements are done from the application and not byinstalling a php accelerator solution.

本文由hew 发布于Linuxsky 论坛,网址:http://bbs.linuxsky.org/thread-5313-1-1.html

你的鼓励,我的动力.
做人厚道,看贴回贴.
my linux blog

TOP

发新话题