Tips for improving performance of five PHP7 instances

Source: Internet
Author: User
This article will share with you five tips for optimizing and improving the performance of PHP7. if you are interested in improving the performance of php7, you can learn more. PHP7 has been released as the biggest version upgrade of phpin the past 10 years, for the biggest performance upgrade, PHP 7 has shown significant performance improvement in multiple tests. However, I still want to remind you of a few things to maximize the performance.

The code is as follows:


Opcache. huge_code_pages = 1


In this way, PHP uses large memory pages to store its text segments and the huge in memory allocation, reducing TLB miss and thus improving performance.

The code is as follows:


Opcache. file_cache =/tmp


In this way, PHP will Cache some Opcode binary export files under the/tmp directory, which can exist across the PHP lifecycle.

The code is as follows:


$ Make prof-gen

Then train PHP using your project, such as for Wordpress:

The code is as follows:


$ Sapi/cgi/php-cgi-T 100/home/huixinchen/local/www/htdocs/wordpress/index. php>/dev/null


That is, let php-cgi run the wordpress homepage 100 times to generate some profile information during this process.

Finally:

$ make prof-clean$ make prof-use && make install

At this time, the PHP 7 you compiled is the most high-performance compilation version tailored for your project.

So much for the time being. I will try again later. please try thanks.

The above small series will share with you five PHP7 performance optimization and improvement skills. I hope you will like them.

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.