Accelerated php,zendopcache_php Tutorial with Zend Opcache

Source: Internet
Author: User
Tags apc anchorlink

Accelerate Php,zendopcache with Zend Opcache


Optimizer+ is the first and fastest opcode caching tool for Zend developed closed-source, but free-to-use PHP optimization acceleration components. Now, Zend technology company will optimizer+ under PHP License open source becomes Zend Opcache.

The Zend Opcache provides faster PHP execution through opcode caching and optimization. It stores precompiled script files in shared memory for later use, avoiding the time consuming of reading code from disk and compiling it. It also applies some code optimization patterns to make code execution faster.

1. What is the opcode cache?

When the interpreter finishes parsing the script code, it generates intermediate code that can be run directly, also known as the opcode (Operate code,opcode). The goal of the Opcode cache is to avoid duplication of compilation and reduce CPU and memory overhead. If the performance bottleneck for dynamic content is not CPU and memory, but I/O operations, such as disk I/O overhead from database queries, the performance gains of the opcode cache are very limited. But since the opcode cache can lead to a reduction in CPU and memory overhead, this is always a good thing--in an environmentally friendly manner, you should also minimize consumption. :D

Modern opcode buffers (optimizer+,apc2.0+, others) are stored using shared memory and can be executed directly from the file without the "deserialization" code before execution. This leads to significant performance acceleration, which typically reduces the overall server's memory consumption and has few drawbacks.

2. Comparison of advantages and disadvantages between optimizer+ and APC

Optimizer+ was renamed Opcache in mid-March 2013.

Based on the discussion on the PHP wiki, Zend Opcache is about to be integrated into PHP 5.5. As an APC competitor, the new Zend Opcache is likely to replace the APC location, although Optimizerplus does not have the user cache function like APC.

optimizer+ Advantages Relative to APC

Advantages of APC Relative optimizer+

3. Using Zend Opcode

It is now possible to use Zend Opcache instead of APC as the PHP Optimizer acceleration tool. The current Zend Opcode is compatible with PHP 5.2.*, 5.3.*, 5.4.*, and PHP-5.5 development editions. However, support for PHP 5.2 will be canceled in the future.

Note : Zend opcache conflicts with Eaccelerator. To install Zend Opcache, you may need to uninstall eaccelerator--first if you use this accelerator module.

Install and configure from source

Zend Opcache's source code is hosted on GitHub and is currently called Zendoptimizerplus.

The installation steps are described in the README file.

Attention:

By the way, Php-devel is required to compile the installation from the source code. The beginning of the Quick Install section of the README is used,

$PHP _dir/bin/phpize

If you don't know the path to the Phpize,

Whereis phpize

The README file also has the corresponding recommended optimization settings.

Installing and configuring from a EPEL source

I do not like to compile the installer from the source code, one is the level is limited, one is afraid of trouble. The following is an example of installing Zend Opcache from the EPEL installation source to the CentOS operation, based on my VPS configuration.

The EPEL community has provided a Zend Opcache installation package that can be installed directly with Yum. Of course, the premise is that you have configured an installation source that uses EPEL. If not, you can refer to this.

As a reminder, PHP on the REMI installation source is already in version 5.4. Given the test that WordPress has better performance on PHP 5.4 than on PHP 5.3 (10% faster and lower ram consuming), it's not a bad thing to upgrade PHP by the way.

Operation Steps:

Check to see if it started correctly:

Php-v

The output is similar to the following:

PHP 5.4.14 (CLI) (built:apr 11:04:35) Copyright (c) 1997-2013 the PHP groupzend Engine v2.4.0, Copyright (c) 1998- Zend Technologies with    Zend opcache v7.0.1, Copyright (c) 1999-2013, by Zend Technologies


reproduced in: http://cnzhx.net/blog/zendopcache-accelerate-php/Thanks to theoriginal

http://www.bkjia.com/PHPjc/1095472.html www.bkjia.com true http://www.bkjia.com/PHPjc/1095472.html techarticle using the Zend opcache acceleration Php,zendopcache optimizer+ is the first and fastest Zend caching tool for opcode developed closed-source, but free-to-use PHP optimization acceleration components. Now ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.