Skip to content
This repository was archived by the owner on Oct 26, 2018. It is now read-only.

Added HHVM (experimental)#68

Open
joehoyle wants to merge 2 commits intomasterfrom
hhvm
Open

Added HHVM (experimental)#68
joehoyle wants to merge 2 commits intomasterfrom
hhvm

Conversation

@joehoyle
Copy link
Member

As some may have heard, HHVM just announced support for FastCGI (http://www.hhvm.com/blog/1817/fastercgi-with-hhvm), this makes it a lot easier to run with something like WordPress, as you can use the exact same Nginx configuration and then proxy_pass requests to PHP files to the hhvm-fastcgi daemon.

Why would you want to do this? Anyone's guess, I wanted to try out the new toys, and see what the performance improvement over PHP-FPM was. For anyeone wondering, so far I havn't managed to make it perform faster than PHP-FPM (unlike what the article above seems to say). I assume this is because typically a WordPress page load is 80% DB / Network IO where something like HHVM is not going to make a difference.

To actually try this out, you still need to do a few things after highstating. Firstly, PHP-FPM will be running on port 9000 - rather than running much HHVM and FPM side-by-side it's easier to just stop FPM so you don't have to make any alterations to the Nginx conf:

sudo service php5-fpm stop

Now you are free to start hhvm-fastcgi, however - with the current config, hhvm needs to be started in the dir you want to run the site from, as Nginx is not currently passing the path to different web roots. For example, to run hhvm on the base wordpress trunk install:

cd /srv/www/wordpress.dev
hhvm --mode daemon -vServer.Type=fastcgi -vServer.Port=9000

All requests to the hhvm will now be serving WordPress.

@joehoyle
Copy link
Member Author

For anyone interested, this is some comparitive benchmarks between hhvm and standard PHP.

Batcached page

HHVM FastCGI
Concurrency Level:      2
Time taken for tests:   0.325 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      10660300 bytes
HTML transferred:       10626400 bytes
Requests per second:    307.46 [#/sec] (mean)
Time per request:       6.505 [ms] (mean)
Time per request:       3.252 [ms] (mean, across all concurrent requests)
Transfer rate:          32008.32 [Kbytes/sec] received
PHP-FPM
Concurrency Level:      2
Time taken for tests:   0.463 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      10658700 bytes
HTML transferred:       10626400 bytes
Requests per second:    216.06 [#/sec] (mean)
Time per request:       9.257 [ms] (mean)
Time per request:       4.628 [ms] (mean, across all concurrent requests)
Transfer rate:          22488.97 [Kbytes/sec] received

Uncached page (with object cache)

HHVM FastCGI
Concurrency Level:      2
Time taken for tests:   13.894 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      10635700 bytes
HTML transferred:       10613900 bytes
Requests per second:    7.20 [#/sec] (mean)
Time per request:       277.885 [ms] (mean)
Time per request:       138.943 [ms] (mean, across all concurrent requests)
Transfer rate:          747.53 [Kbytes/sec] received
PHP-FPM
Concurrency Level:      2
Time taken for tests:   6.570 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      10637300 bytes
HTML transferred:       10613900 bytes
Requests per second:    15.22 [#/sec] (mean)
Time per request:       131.395 [ms] (mean)
Time per request:       65.698 [ms] (mean, across all concurrent requests)
Transfer rate:          1581.18 [Kbytes/sec] received

@owaincuvelier
Copy link

So it looks as if php-fpm is better without caching, and presumably most WP sites don't have any caching on them right?

@joehoyle
Copy link
Member Author

@owaincuvelier right, to be honest, I need to dig into it more, as it should be faster. However, there is also hhvm directly (running as a web server, not FastCGI server) to test against, to see if the slow down is there or not.

@fossxplorer
Copy link

Very interesting @joehoyle. Subscribing to this one :)
Btw, did you give HHVM some 'warm up' rounds?

@jg-development
Copy link

Hi,

I made some further ApacheBench Test. You can see them here:
http://www.jg-dev.de/hhvm-performance-apache-bench

It is in german, but the numbers are speaking for themselves ;-)
HHVM is awesome.

@willmot
Copy link
Member

willmot commented Feb 25, 2014

Is this something we'll look to merge into master at some point?

@danielbachhuber
Copy link
Contributor

Nope, just for demo

On Tuesday, February 25, 2014, Tom Willmot notifications@github.com wrote:

Is this something we'll look to merge into master at some point?

Reply to this email directly or view it on GitHubhttps://github.com//pull/68#issuecomment-36004500
.

BronsonQuick pushed a commit that referenced this pull request Aug 4, 2015
BronsonQuick pushed a commit that referenced this pull request Aug 4, 2015
Remove Sticky Custom Post Types. Fixes #68
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants