It looks like you're new here. If you want to get involved, click one of these buttons!
HHVM stands for HipHop Virtual Machine, for those who are not aware. It is what facebook uses to run its infrastructure.
Around 2008 facebook needed to optimize their architecture.
They needed something that would be more suitable for scale and performance than the Zend engine that PHP usually runs on.
Their first incarnation was a php to binary compiler called HPHPc which was open sourced in 2010, it was powerful but had limitations in terms of running existing web architecture, that wasn't specifically designed for it.
HHVM is an new execution engine for PHP which runs as virtual machine that JIT (just in time) compiles php. It is exclusively for 64 bit architecture.
However is HHVM is not just an execution engine, but is a web server in one. So you don't need apache or nginx necessarily, however you can also proxy with nginx or apache.
Given that I have been hearing great things about it recently and it is nearing total support for PHP 5.4 I wanted to try it out. I was curious as to how it would perform against some typical setups of apache and nginx in a load test.
This is not totally scientific, but wanted to idealize the test as far as possible. So I installed a fresh copy of Linux Mint 15. There is a binary packages for hhvm for several distros, however I found run smoothly most up to date master was, so compiling form source was the way to go. I will cover setup later.
But without further ado the the test and results:
No real additional optimizations, only thing it to increase connections/files on nginx and fcgi proxy to make it comparable.
Simulate browsing load using JMeter with a basic HTTP Get request to index.php?p=/discussions, 500 threads with a ramp up period of 2 seconds.
Simulate a discussion post load using JMeter with a basic HTTP POST request to index.php?p=/post/discussion/ then handle subsequent GET redirect to post, 300 threads with a ramp up period of 2 seconds.
I must say I was pretty impressed HHVM is clearly very fast 3-4 times faster and the throughput 2.5 as much. On post+redirect it was astounding x3-5 throughput . But really it makes sense the code is optimized, so everything including the PDO/Databases connection is going to be very fast. the other are just servers they may be individualyl fast, but can't speed up the execution.
I love it when posts don't feel laboured, and all those posts 300 where posted an redirected in a flash.
None of these tests have any other features such APC or Memcached, which is for another day. Also fronting HHVP with other servers.
Nginx was not as good as apache, in the post operation which is disappointing, but bear in mind there is lot of configuration you can do regarding php-fpm and nginx. Also nginx has sensible default settlings and this is not really a 'sensible' test but a more extreme test.
I think most importantly point is HHVM it is pretty resilient. I test with with thousands thread an it held up ok, with stable output.
grep is your friend.