Using Opcache to improve PHP performance

Source: Internet
Author: User

improve PHP performance with Opcache wdd2007wdd20071. 6k January 29 Release recommendation0Featured Collections5Collection2. 3k browsing Opcache improves PHP execution speed by caching and optimizing the opcode. In PHP5.5、5.6The Opcache is built in the version, and--enable-opcache can be used when compiling the installation. Php5.2-5.4can also be installed manually. Project Home http://Pecl.php.net/package/zendopcacheOpen method Modify php.ini file sudo vim/etc/php.ini on the last side of the file:; switch open opcache.enable=1; available memory, as appropriate, unit megabytesopcache.memory_consumption= themaximum number of cached files, not hit -%, you can try to raise this value Opcache.max_accelerated_files= the; Opcache will check the file modification time within a certain time, here set the check time period, default is2, Unit is seconds opcache.revalidate_freq= -; internedstringmemory size, can also be adjusted Opcache.interned_strings_buffer=8, whether it is closed quickly, and the speed at which the memory is reclaimed when PHP Request shutdown is turned on will increase Opcache.fast_shutdown=1; do not save files/comment Opcache.save_comments of the function=0Check Installation: PHP-v PHP5.5.3-1ubuntu2.2(CLI) (Built:feb -  the  -: .: to) Copyright (c)1997- -The PHP Group Zend Engine v2.5.0, Copyright (c)1998- -Zend Technologies with Zend opcache v7.0.3-dev, Copyright (c)1999- -, by Zend Technologies Restart service sudo/etc/init.d/php-fpm Restartsudo/etc/init.d/nginx Restart view effects have a beautiful graphical interface for the project: https://Github.com/peehaa/opcacheguiSingle-file, easy-to-deploy project: https://Github.com/rlerdorf/opcache-statusTip If you find that you have not executed or old code after updating your code, you can use function Opcache_reset () to clear the cache. The function resets the entire byte-code cache. After calling Opcache_reset (), all the scripts will be re-loaded and re-parsed the next time they are clicked. Reference:1, using Opcache to elevate PHP5.5+ Program Performance: https://phphub.org/topics/3012, zendopcache official download: http://Pecl.php.net/package/zendopcache3, a little share about Zend o+: http://www.laruence.com/2013/11/11/2928.html4, Ocp-opcache Control Panel:https://gist.github.com/ck-on/4959032 Click to preview5, PHP WIKI discussion on integrating Zendopcache into the release: https://Wiki.php.net/rfc/optimizerplusZend-Opcache Opcache

Using Opcache to improve PHP performance

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.