The Zend OPcache module (formerly known as Zend Optimizer+) provides faster PHP execution through opcode caching and optimization. It improves PHP performance by storing pre-compiled script bytecode in the shared memory. This eliminates the stages of reading code from the disk and compiling it on future access. In addition, it applies a few bytecode optimization patterns that make code execution faster.
How it works
PHP is an interpreted language. This means that each time a PHP generated page is requested, the server must read in the various files needed and "compile" them into something the machine can understand (opcode). A typical web page requires more than a dozen of these bits of code to be compiled. Opcode cache mechanisms preserve this generated code in cache so that it only needs to be generated once to serve hundreds or millions of subsequent requests. Enabling opcode cache will reduce the time it takes to generate a page by up to 90%.
Why Zend OPcache?
Although many different opcode cache modules are available — such as XCache, eAccelerator and APC — WoodWing has decided to go for Zend OPcache because of the following reasons:
- Tests have shown us that this optimizer is by far the fastest out there
- It is available as open source
- It is integrated by default in PHP 5.5
Installation
OPCache is enabled by default In PHP 5.5 unless PHP is compiled with the --disable-all
option.
When this is the case, OPCache can be enabled by compiling PHP with the --enable-opcache
option.
Note: For more information, see the PHP documentation OPCache installation.
Comments
Do you have corrections or additional information about this article? Leave a comment!
Do you have a question about what is described in this article? Please contact support here.
0 comments
Please sign in to leave a comment.