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.