HHVM on Amazon EC2 in 2 minutes

HHVM on Amazon EC2 in 2 minutes

Probably you already heard about  HHVM . As on their website:

HHVM is an open-source virtual machine designed for executing programs written in Hack  and PHP . HHVM uses a just-in-time (JIT) compilation approach to achieve superior performance while maintaining the development flexibility that PHP provides.

Using simple terms – HHVM allows you run scripts written in PHP but much, much more faster. Obviously you the main purpose of HHVM is to run HACK language, but it works pretty good with PHP itself.

Update: 2 Dec 2014. You don’t have to use my image, you can install it from this repo:

wget http://www.hop5.in/yum/el6/hop5.repo -O /etc/yum.repos.d
echo 'priority=9' >> hop5.repo
echo 'includepkgs=glog,tbb' >> hop5.repo
wget http://yum.devopsx.com/devopsx-amazon.repo
yum install hhvm

 

Because i’m huge fan of speed I decided to give it a try, and run some benchmark. As for today the biggest issue with HHVM is compilation process. It takes ages to compile. If you follow [these instructions] ( https://github.com/facebook/hhvm/wiki/Building-and-installing-HHVM-on-Amazon-Linux-2014.03 ) it takes around 30-45 minutes even if you use  c3.4xlarge instance. So… I compiled it once, and you can utilise my AMI to give it a try. AMI which i created has id ami-355f3c0f.

Instructions are pretty basic – if you are lost, leave comment here.