PHP ~ Performance comparison with various acceleration tools ~_php Tutorial

Source: Internet
Author: User
Tags hhvm zts
XCache Introduction to the principle and function of the PHP accelerator (see Lamp architecture of the PHP-FPM server), XCache as one of the most widely used PHP accelerator, its performance than the early Eaccelerator accelerator to be good, Therefore, this time the PHP program in the implementation of the accelerator XCache on its performance impact. 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 add-on module for PHP./configure --enable-xcache--with-php-config=/usr/local/php/bin/php-configmake && make install# at the end of installation, will appear similar to the following line: Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/# Edit PHP.ini, integrate PHP and xcache:# first to import the sample configuration provided by XCache PHP.INIMKDIR/ETC/PHP.D # This is the configuration file that was configured when you installed PHP in the previous scan directory CP XCACHE.INI/ETC/PHP.D # The Xcache.ini file is in the XCache source directory. # Next Edit/etc/php.d/xcache.ini, find the line beginning with extension and modify it to the following line: Extension =/usr/local/php/lib/php/extensions/ no-debug-non-zts-20100525/xcache.so# If there are multiple extension command lines in the php.ini file, make sure that this new row is ranked first. # See if XCache has been installed successfully:/usr/local/php/bin/php-m |grep-i xcache Copy Code Opcache Introduction to the New generation of PHP accelerator, developed by Zend Company, its implementation principle and XCache similar, is to buffer the PHP data into memory to avoid duplication of the compilation process, 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 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 install# configuration file Settings, Can be directly at the end of the php.ini to add the following, but this in the PHP configuration file scanning directory PHP.D configuration of new files Opcache.ini, easy to manage, Php-config-scan-dir is compiled to install PHP defined by the # VI/ETC/PHP.D /opcache.ini[opcache]zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/ OPCACHE.SOOPCACHE.MEMORY_CONSUMPTION=128 # Allocated memory size, in MB, that is able to store how much precompiled PHP code opcache.interned_strings_buffer=8 # Interned string accounts for memory size, unit mbopcache.max_accelerated_files=4000 # allows cached maximum number of files Opcache.revalidate_freq=60 # How long to check file timestamps, To change the shared memory allocation in Sopcache.fast_shutdown=1 # whether to turn on the Fast Shutdown queue feature, 1 to enable the Opcache.enable_cli=1 # allow the PHP program under the Cache CLI # Check the module installation succeeded:/usr/local /php/bin/php-m |grep-i Opcache Copy Code HHVM introduction HipHop VM (HHVM) is a virtual machine launched by Facebook to execute PHP code, it is a PHP JIT (just-in-time) compiler, It also has the advantage of generating fast code and instant compiling, and the execution efficiency of HHVM is significantly improved by translating PHP code into C + + programs, and according to Facebook, HHVM has achieved significant improvements in speed, 60% faster than the PHP interpreter currently in use and 90 less memory % installation HHVM Because the current HHVM is also in the development stage, the domestic production environment is still very few, the installation of the required ringMore complex environment (such as CentOS6.5 under the Boost-system and Boost-filesystem version is too low), I am also in the commissioning test phase, and so out of the test results, and then the HHVM test results are posted. Test steps # Find another virtual machine, stress test the httpd server (192.168.1.110) # test tool using Apache's own benchmark tool AB can be tested as follows: Ab-c 20-n/http 192.168.1.110:8080/index.php# Note: The test takes 20 concurrency and, without affecting access, looks at the acceleration effect of the XCache accelerator; test page Use the login page of the previous deployment of the newly deployed phpMyAdmin index.php # Note: In order to better test the PHP accelerator cache features, you can test a few times in a row, get a stable value

http://www.bkjia.com/PHPjc/766056.html www.bkjia.com true http://www.bkjia.com/PHPjc/766056.html techarticle XCache Introduction to the principle and function of the PHP accelerator (see Lamp architecture of the PHP-FPM server), XCache as one of the most widely used PHP accelerator, its performance than the earlier ...

  • Related Article

    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.