Take the article page, for example, through the chrome capture package, waiting time to 147ms, in fact, before the cache optimization, this page about 4 SQL statements, the speed is only about 152ms, the difference is not small, so I decided to install Zend Opcache accelerated PHP.
When I installed the Zend Opcache on the server, and then tested, waiting has dropped to 68ms, the effect is obvious.
It is also necessary to install such PHP accelerators for the So,laravel project.
Installation Tutorial:
The Zend Opcache (Zendoptimizerplus) project is currently hosted on GitHub and the project address is: Https://github.com/zendtech/ZendOptimizerPlus The installation steps are described in detail above, Let's just say it briefly:
1. Download
In the bottom right corner of the project page there is a download Zip button, click it can download and upload to the server, you can also right-click Copy link to the server through wget download. 2.unzip Unzip, enter directory
Copy the Code code as follows:
CD Zendoptimizerplus-master
3. Installation
Copy the Code code as follows:
$PHP _dir/bin/phpize
./configure--with-php-config= $PHP _dir/bin/php-config
Make && make install
Where $PHP _dir is your PHP installation directory, if you do not know, you can try
Copy the Code code as follows:
which PHP
Then ls-l get the path to find the PHP installation directory, generally if it is compiled through the source code, in/usr/local/php. It may also be installed through a third-party package manager, as long as you find Phpize and Php-config. When the compilation is complete, you get a hint:
Copy the Code code as follows:
Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/
This is to tell you the compiled extension. so file location, after we edit php.ini, this configuration file either in $php_dir/etc or in/usr/local/etc/or something, anyway open it, add at the end
Copy the Code code as follows:
[Zend Opcache]
opcache.memory_consumption=128
Opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
Opcache.revalidate_freq=60
Opcache.fast_shutdown=1
Opcache.enable_cli=1
Save exit, restart PHP-FPM or Apache.
The above is the whole content of this article, I hope you can enjoy.