PHP 5.5/PHP5.6/PHP-NG and HHVM which has better performance?

Source: Internet
Author: User
Tags hhvm

PHP 5.5/PHP5.6/PHP-NG and HHVM which has better performance?

Abstract: In a Vagrant-based local environment, the HHVM test results may be poor due to an error. With the help of HHVM partners, this cause is still being studied! However, in a 4 GB Virtual Machine in DigitalOcean, HHVM even overwrites the latest PHP-NG!

Conclusion: they reflect better performance of HHVM (after JIT hot boot), although for some reason we cannot obtain these results in all the equipment.

If you remember writing an article a few months ago, WordPress 3.9 showed that it fully supported HHVM, and we were thrilled. The initial benchmark test results show that HHVM is much more advanced than the Zend engine that drives all current PHP builds. Later, the problem came out:

  • HHVM can only run as a single user, which means that (in a shared environment) security is poor
  • HHVM does not automatically restart after it crashes. Unfortunately, it still occurs frequently so far.
  • HHVM uses a large amount of memory at startup, although it has a lower memory usage for a single request than a PHP-FPM of the same size

Obviously, you have to make a compromise based on your (or, more specifically, your site) needs. Is that worth it? After switching to HHVM, how much performance improvement do you expect?

At Kinsta, we really want to test all new technologies and usually optimize all of them to provide the best environment for our customers. Today, I finally spent some time configuring the test environment and conducting some tests to compare two different builds. One is the newly released WordPress installation, the other one adds a large amount of content to WooCommerce! To measure the running time of the script, I simply added

  1. <?php timer_stop(1);?>

This line is marked before/body of footer. php.

Here is the configuration environment details:

  • DigitalOcean 4 GB raindrops container (2 CPU core, 4 gb ram)
  • Ubuntu 14.04, MariaDB10
  • Test site: The Munditia topic of the demo content has been imported, WooCommerce 2.1.12 & WordPress 3.9.1
  • PHP 5.5.9, PHP 5.5.15, PHP 5.6.0 RC2, PHP-NG (20140718-git-6cc0000d) and HHVM 3.2.0 (Version: PHP 5.6.99-hhvm)

There is no further huge weekly chapter, and these are my test results. The lower the value, the better, in seconds:

DigitalOcean 4 GB raindrops container

The Unit is seconds. The operation is performed 10 times. The lower the unit, the better.

It looks like the PHP-NG gets the peak performance after it's first run! HHVM requires several more reloads, but their performance looks similar! I can't wait for the PHP-NG to merge into the development trunk! :)

The number of hits per minute. The higher the value, the better.

Disable OpCache in PHP 5.5.15

  • Execution: 236 hits
  • Availability: 100.00%
  • Time consumed: 59.03 secs
  • Transmitted data: 2.40 MB
  • Time responded: 2.47 secs
  • Execution rate: 4.00 trans/sec
  • Throughput: 0.04 MB/sec
  • Concurrency: 9.87
  • Successful: 236
  • Failed execution: 0
  • Maximum execution: 4.44
  • Minimum execution: 0.48

PHP 5.5.15 enable OpCache

  • Execution: 441 hits
  • Availability: 100.00%
  • Time consumed: 59.55 secs
  • Transmitted data: 4.48 MB
  • Time responded: 1.34 secs
  • Execution rate: 7.41 trans/sec
  • Throughput: 0.08 MB/sec
  • Concurrency: 9.91
  • Successful: 441
  • Failed execution: 0
  • Maximum execution: 2.19
  • Minimum execution: 0.64

PHP 5.6 RC2 disable OpCache

  • Execution: 207 hits
  • Availability: 100.00%
  • Time consumed: 59.87 secs
  • Transmitted data: 2.10 MB
  • Time responded: 2.80 secs
  • Execution rate: 3.46 trans/sec
  • Throughput: 0.04 MB/sec
  • Concurrency: 9.68
  • Successful: 207
  • Failed execution: 0
  • Maximum execution: 3.65
  • Minimum execution: 0.54

PHP 5.6 RC2 enable OpCache

  • Execution: 412 hits
  • Availability: 100.00%
  • Time consumed: 59.03 secs
  • Transmitted data: 4.18 MB
  • Time responded: 1.42 secs
  • Execution rate: 6.98 trans/sec
  • Throughput: 0.07 MB/sec
  • Concurrency: 9.88
  • Successful: 412
  • Failed execution: 0
  • Maximum execution: 1.93
  • Minimum execution: 0.34

HHVM 3.2.0 (Version: PHP 5.6.99-hhvm)

  • Execution: 955 hits
  • Availability: 100.00%
  • Time consumed: 59.69 secs
  • Transmitted data: 9.18 MB
  • Time responded: 0.62 secs
  • Execution rate: 16.00 trans/sec
  • Throughput: 0.15 MB/sec
  • Concurrency: 9.94
  • Successful: 955
  • Failed execution: 0
  • Maximum execution: 0.85
  • Minimum execution: 0.23

PHP-NG enables OpCache (Build: Jul 29 2014)

  • Execution: 849 hits
  • Availability: 100.00%
  • Time consumed: 59.88 secs
  • Transmitted data: 8.63 MB
  • Time responded: 0.70 secs
  • Execution rate: 14.18 trans/sec
  • Throughput: 0.14 MB/sec
  • Concurrency: 9.94
  • Successful: 849
  • Failed execution: 0
  • Maximum execution: 1.06
  • Minimum execution: 0.13

Note: The previous test result (incorrect) is omitted here. If you are interested, visit the original article to view it.

HHVM details: click here
HHVM: click here

Recommended reading:

CentOS5 install Nginx1.4 + PHP5.5 FastCGI

Install Apache FastCGI module (mod_fastcgi) on CentOS)

Ubuntu Apache FastCGI virtual host Installation

LNMP implements Nginx, PHP, and MySQL separation based on FastCGI

Two Web servers implement Load Balancing + FastCGI module + MySQL implement distributed architecture

This article permanently updates the link address:

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.