PHP ~ and the performance of the accelerated tool comparison ~

Source: Internet
Author: User
Tags add comparison config hhvm install php ini php and php code
XCache Introduction   The principles and functions of the PHP accelerator (see the Lamp Architecture php-fpm server), XCache as one of the most widely used PHP accelerators, is better than the earlier Eaccelerator accelerator. Therefore this time compares the PHP program in the execution time accelerator XCache to its performance influence.       Installation xcache   Copy code # Install tar XF xcache-3.0.3.tar.gz CD xcache-3.0.3/usr/local/php/bin/phpize # XCAC He is installed as an add-in module for PHP./configure--enable-xcache--with-php-config=/usr/local/php/bin/php-config make && make Install # At the end of the installation, a similar line appears: Installing shared extensions:    /usr/local/php/lib/php/extensions/ no-debug-non-zts-20100525/# Edit PHP.ini, consolidate PHP and XCache: # First import the sample configuration provided by XCache to PHP.ini MKDIR/ETC/PHP.D # This is the configuration file that was configured before PHP was installed scan directory CP XCACHE.INI/ETC/PHP.D # Xcache.ini files in the XCache source directory. # Next Edit/etc/php.d/xcache.ini, find the line at the beginning of extension, and modify it to the following line: Extension =/usr/local/php/lib/php/extensions/ No-debug-non-zts-20100525/xcache.so # If you have more than one extension instruction line in the php.ini file, make sure that the new row is in the first place. # to see if 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 Company, its realization principle and XCache is similar to buffering PHP data into memory to avoid duplication of compilation processes, can directly use the buffer compiled code to improve speed, reduce server load, but performance is more superior than XCache, see test results   installation Opcache       Replication code wget http:// Pecl.php.net/get/zendopcache-7.0.2.tgz tar xzf zendopcache-7.0.2.tgz cd zendopcache-7.0.2/usr/local/php/bin/phpize. /configure--with-php-config=/usr/local/php/bin/php-config make make install # configuration file settings, You can add the following directly at the end of the php.ini, but configure the new file Opcache.ini in the scan directory PHP.D of the PHP configuration file, which is easy to manage, Php-config-scan-dir is defined when you compile and install PHP # VI/ETC/PHP.D /opcache.ini [Opcache] zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/opcache.so OPCACHE.MEMORY_CONSUMPTION=128 # allocates memory size in MB, that is, how much precompiled PHP code can be stored opcache.interned_strings_buffer=8 # interned string takes up memory size , MB opcache.max_accelerated_files=4000 # allows maximum number of cached files Opcache.revalidate_freq=60 # How long does it take to check the file timestamp to change the shared memory allocation, in S Opcache.fast_shutdown=1 # Whether to turn on the fast shutdown queue function, 1 for open Opcache.enable_cli=1 # allows caching of PHP programs under CLI #检查模块安装成功:/usr/local/php/bin/php-m Grep-i opcache Copy Code HHVM profile   HipHop VM (HHVM) is a virtual machine that Facebook launches to execute PHP code, which is a JIT (just-in-time) compiler for PHP, With both the Quick Code and just-in-time compilationadvantages;   HHVM translates PHP code into C + + programs to perform, and performs significantly more efficiently;   According to Facebook, HHVM has made significant improvements in speed, 60% faster than the PHP interpreter currently in use and 90% less memory   Installation HHVM   because the HHVM is still in the research and development phase, the domestic production environment is still very small, Installation requirements of the environment is more complex (such as CentOS6.5 under the Boost-system and Boost-filesystem version is too low), so I am still in the commissioning test phase, and so out of the test results, and then HHVM test results posted.       Test steps   # Find another virtual machine, pressure test for httpd server (192.168.1.110) # test tools use Apache's own benchmark tools AB can # test method as follows: Ab-c 20- n http://192.168.1.110:8080/index.php # Note: Test with 20 concurrency, without affecting access, to view the acceleration effect of the XCache accelerator The test page uses the previous phpMyAdmin login page index.php can be # Note: In order to better test the PHP accelerator cache characteristics, can be more than a few consecutive tests, to obtain a stable value   

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.