Xcache has previously introduced the principles and functions of the PHP accelerator (see the PHP-FPM server of LAMP architecture), xcache as one of the widely used PHP accelerators, its performance is better than that of the early eAccelerator, so this time we will compare the performance impact of the accelerator xcache on PHP programs during execution. Install xcache copy Code # Install tar xf xcache-3.0.3.tar.gzcd xcache-3.0.3/usr/local/php/bin/phpize # xcache is installed as an external module of php. /configure -- enable-xcache -- with-php-config =/usr/local/php/bin/php-configmake & make install # the following lines will appear at the end of installation: installing shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/# edit php. ini, integrating php and xcache: # first import the sample configuration provided by xcache to php. inimkdir/etc/php. d # This is the configuration file scan directory configured during PHP installation. The cp xcache. ini/etc/php. d # xcache. ini file is in the xcache source code directory. # Edit/etc/php. d/xcache. ini, locate the line starting with extension and modify it to the following line: extension =/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/xcache. so # If php. there are multiple extension command lines in the INI file. Make sure that the new lines are in the first place. # Check whether xcache has been installed successfully:/usr/local/php/bin/php-m | grep-I xcache copy code Opcache Introduction New Generation PHP accelerator, developed by Zend, the implementation principle is similar to that of Xcache. It caches the executed PHP Data to the memory to avoid repeated compilation processes. It can directly use the compiled code in the buffer zone to increase the speed, reduces the server load, but the performance is more superior than Xcache, see the test results install Opcache copy code wget http://pecl.php.net/get/zendopcache-7.0.2.tgztar xzf zendopcache-7.0.2.tgzcd zendopcache-7.0.2/usr/local/php/bin/phpize. /configure -- with-php-config =/usr/local/php/bin/php-configmakemake ins Tall # configuration file settings, which can be directly configured in php. add the following content at the end of ini, but in the PHP configuration file's scan Directory php. d. Configure the new file opcache. ini, which is easy to manage. php-config-scan-dir is defined during PHP compilation and installation # vi/etc/php. d/opcache. ini [opcache] zend_extension =/usr/local/php/lib/php/extension/ no-debug-non-zts-20100525/opcache. soopcache. memory_consumption = 128 # size of allocated memory, in MB, that is, the amount of pre-compiled PHP code opcache that can be stored. interned_strings_buffer = 8 # memory size occupied by interned strings, in MBopcache. max_accelerated_files = 4000 # maximum number of files that can be cached op Cache. revalidate_freq = 60 # How long does it take to check the file timestamp to change the shared memory allocation, in sopcache. fast_shutdown = 1 # Whether to enable and disable the queue function quickly. 1. Enable opcache. enable_cli = 1 # Allow PHP programs under the cache CLI # Check whether the module is installed successfully: /usr/local/php/bin/php-m | grep-I opcache copy code hhvm overview HipHop VM (HHVM) is a virtual machine launched by Facebook to execute PHP code, it is a JIT (Just-In-Time) compiler of PHP and has the advantages of generating fast code and real-Time compilation. hhvm converts PHP code compilation into a C ++ program for execution, the execution efficiency has been significantly improved. According to Facebook's leakage, HHVM has made significant improvements in speed, which is 60% faster than the current PHP interpreter, the memory usage is reduced by 90% because hhvm is still installed In the R & D phase, there are few domestic production environments and the environment required for installation is relatively complex (for example, boost-system and boost-filesystem versions under CentOS6.5 are too low ), therefore, I am still in the debugging and testing phase, wait for the test results, and then paste the hhvm test results together. Test procedure # Find another virtual machine and perform a stress test on the HTTPD server (192.168.1.110) # Use the benchmark test tool AB provided by Apache. # The test method is as follows: AB-c 20-n 2000 http: // 192.168.1.110: 8080/index. php # Note: The test uses 20 concurrent threads and allows you to view the acceleration effect of the xcache accelerator without affecting access. The test page uses the index of the phpMyAdmin logon page just deployed in the previous section. php: # Note: To better test the cache feature of the PHP accelerator, you can perform multiple tests several times in a row to obtain a stable value.