PHP ~ Performance Comparison with various acceleration tools ~
Source: Internet
Author: User
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 accelerator when the PHP program is executing... "/> <scripttype =" text/javascript "Xcache introduction I have previously introduced the principles and functions of the PHP accelerator (see PHP-FPM server in LAMP architecture ), xcache, as one of the widely used PHP accelerators, has better performance than the early eAccelerator accelerators. Therefore, this article compares the performance impact of 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, server load is reduced, but the performance is better than Xcache. for details, see the test result and install Opcache to copy the code wget. http://pecl.php.net/get/zendopcache-7.0.2.tgztar Xzf zendopcache-7.0.2.tgzcd/usr/local/php/bin/phpize. /configure -- with-php-config =/usr/local/php/bin/php-configmakemake install # set the configuration file, which can be directly 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 = 12 8 # 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 in opcache. 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 php jit (Just-In-Ti Me) compiler, with the advantages of generating fast code and real-time compilation; hhvm converts PHP code compilation into a C ++ program for execution, significantly improving the execution efficiency; according to Facebook's leakage, HHVM has been significantly improved in terms of speed, which is 60% faster than the currently used PHP interpreter, and 90% less in memory, because hhvm is currently being developed, there are few domestic production environments, and the environment required for installation is complicated (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 that comes with Apache # test method: 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 recently deployed phpMyAdmin logon page. 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.
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