Press "Enter" to skip to content

A Quick Share on Zend O+

This is the PPT for a topic I shared on the spur of the moment at the "Alibaba PHP Tech Salon" last weekend. It mainly introduces Zend Optimizer Plus (O+ for short).
O+ is a PHP performance tool developed by Zend. Starting with PHP 5.5, it has been released together with the PHP source code, and renamed to Opcache.
Unlike APC, O+ is not just an Opcodes cache — it also does a lot of Opcodes optimization. This PPT mainly lists the key optimizations.
Unlike eaccelerator, O+ does more optimizations.
This is what makes O+ quite a bit faster than APC. Judging by the benchmark (Zend/bench.php), O+ can save 5% of CPU IR and run more than 7% faster.
In addition, now that Opcache has entered the PHP source tree, we're no longer updating APC — our main effort has shifted to further development of O+.
So I'd suggest everyone switch to O+ (it supports 5.2 all the way up to the latest 5.5). Basically you only need to change one config setting and you get a performance boost — why not, right?
A recommended Opcache configuration:

zend_extension=opcache.so
opcache.enable_cli=1
opcache.memory_consumption=128      //shared memory size, adjust to your needs
opcache.interned_strings_buffer=8   //memory size for interned strings, also adjustable
opcache.max_accelerated_files=4000  //maximum number of cached files
opcache.revalidate_freq=60          //check for file updates every 60s
opcache.fast_shutdown=1             //enable fast shutdown; with this on, memory is reclaimed faster
                                    //   during PHP Request Shutdown
opcache.save_comments=0             //don't save file/function comments

For PHP versions before 5.5, you can download the latest O+ here: ZendOpcache

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.