Php5.6+7 Code Performance Acceleration-Turn on Zend opcache-optimize CPU

Source: Internet
Author: User
Tags apc zend

Description

PHP 5.5+ version above, you can use PHP's own opcache to turn on performance acceleration (the default is off). For PHP versions below 5.5, APC acceleration is required, which does not indicate that the PHP APC acceleration method can be searched on its own internet.

PHP Open Opcache method

1. Open the php.ini file (if there is no php.ini in the/usr/local/lib directory of CentOS, then copy a past from PHP after extracting the source file, for example: php.ini-production)

2. Find: [Opcache], set to:

[Opcache]; DLL address Zend_extension=php_opcache.dll; Switch to open opcache.enable=1; Open Cliopcache.enable_cli=1; Available memory, as appropriate, in units: mbopcache.memory_consumption=528; Zend Optimizer + The total memory of the string in the staging pool. (unit: MB) opcache.interned_strings_buffer=8; For multi-cache file limit, hit less than 100%, you can try to improve the value of opcache.max_accelerated_files=10000; Opcache will be in a certain time to check the file modification time, here set check the time period, the default is 2, positioning for the second opcache.revalidate_freq=1; Turn on quick close to open this the memory recovery rate will increase when PHP Request shutdown opcache.fast_shutdown=1

Php5.6+7 Code Performance Acceleration-Turn on Zend opcache-optimize CPU

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.