Since being publicly released, HipHop Virtual Machine (HHVM) has taken the PHP world by storm. HHVM was created by Facebook as an effort to reduce hardware costs, and the results have been mind-boggling. Facebook saw a 6x reduction in CPU usage drastically increasing performance and reducing costs simultaneously.
How does HHVM work?
Straight from the HHVM website:
The plain English translation is that HHVM cuts out the process of compiling PHP as C++ (and then to binary) allowing for faster performance.
Is WordPress compatible with HHVM?
As of WordPress 3.9 WordPress can run on HHVM. Do note that this means that WordPress Core can run on HHVM, not necessarily all themes an plugins. At the time of writing, this website is running on HHVM, though I may switch it back to PHP5-FPM due to reasons discussed in this article.
Drawbacks of HHVM
HHVM has the potential to change the direction of PHP in the future, however, it is still a work in progress. By no means is HHVM truly ready for production. One common problem incurred is frequent crashes. To remedy this, I have created a Cron job that checks every minute to see if HHVM is running, and if it’s not to start the process again. It works, but it’s not clean. This could also be accomplished with upstart scripts.
The other big issue is that not all PHP functions are translated to HHVM (yet). I was working with a client site and testing HHVM out of curiosity to see the performance differences. When going to some pages of the site, I noticed the White Screen of Death. At first I thought it was a problem with the permalinks in my NGINX configuration, but after delving into the error logs I found it was a different error. This site uses Contact Form 7 with the RECAPTCHA plugin and PHP failed because of an “Undefined Standard Function”.
While HHVM is a very promising technology, there are still a lot of kinks to work out. Once all of the standard PHP functions are brought over and it is more stable, HHVM could quite possibly replace the standard PHP interpreter.