发新话题
打印

PHP加速器介绍

PHP加速器介绍

PHP Accelerators/Cacherswill boost the performance of your PHP applications, by caching thecompiled form of php scripts to avoid the overhead of parsing andcompiling the code every time the page is loaded. A PHP accelerator typically reduces server load and increases the speed of your PHP code by 1-10 times. Normally you will install these in the form of a php extension.

Thislist contains all the php accelerator solutions available at this time,with a short description and some personal notes. When choosing a phpaccelerator for your site, you should evaluate:

- evaluate the speed improvement.Normally any php application will gain at least 100% in speed only byinstalling any php accelerator, but you should do your own benchmark tosee if it is useful or not.

- look for any problems caused by this.Your application might break or crash randomly after installing a phpaccelerator. The current solutions look pretty stable, but still thismight 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/

“eAcceleratorwas born in December 2004 as a fork of the Turck MMCache project. TurckMMCache was created by Dmitry Stogov and much of the eAccelerator codeis still based on his work. eAccelerator also contains a PHP encoderand loader. The latest release, 0.9.5, supports PHP 4 and all PHP 5releases including 5.2. In older releases, the encoder will only workwith PHP versions from the 4.x.x branch. eAccelerator will not workwith 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/

“XCacheis a fast, stable PHP opcode cacher that has been tested and is nowrunning on production servers under high load. It is tested (on linux)and supported on all of the latest PHP cvs branches such as PHP_4_3PHP_4_4 PHP_5_0 PHP_5_1 PHP_5_2 HEAD(6.x). ThreadSafe/Windows is alsosupported. It overcomes a lot of problems that has been with othercompeting 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 you will not see areal performance improvement from this)… useful only for the encoder ifneeded by some commercial scripts.

Zend Platform - http://www.zend.com/products/zend_platform

MyOpinion: commercial product; more than an optimizer that has featuresthat 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 it even though itis now discontinued. The natural upgrade for newer versions of php iseAccelerator.

Conclusion: APC, eAccelerator and XCache areall great solutions that can speed up any php application. There aremany benchmarks on the internet showing how one or the other is better,but I would suggest running your own tests and finding the one thatfits best for your application.

From my experience their performance is very similar
,and my personal favorite is eAccelerator, even though I have used APCfor some projects also. At this time I am evaluating and testing XCacheand the initial results look very good.

Keep in mind when you are installing a php accelerator that this is not the end of your php tunings and optimizations and you should look into optimizing the real application.The opcache is a nice addition that can quickly speed up yourapplication but don’t forget about the application itself. You will besurprised that in real life the biggest improvements are done from theapplication and not by installing a php accelerator solution.

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

TOP

发新话题