---
title: lesterchan.net on HHVM
date: 2015-04-28 09:39:33
permalink: https://lesterchan.net/blog/2015/04/28/lesterchan-net-on-hhvm/
author: Lester Chan
categories:
  - Site
tags:
  - HHVM
  - lesterchan.net
---

After the move to [nginx/php-fpm](https://lesterchan.net/blog/2015/03/20/lesterchan-net-on-nginxphp-fpm-mariadb/), the next natural course of action is to move to HHVM and php-fpm as a fallback.

**What is HHVM?**

> [HHVM](http://hhvm.com/) 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. HHVM is developed by Facebook.

As a result my response time drop by another 400ms to about 1,500ms from 1,900ms as shown in the screenshot below.

[![lesterchan.net Response Times (HHVM)](https://farm8.staticflickr.com/7686/17045521047_68ee86a5a3_c.jpg "lesterchan.net Response Times (HHVM)")](https://farm8.staticflickr.com/7686/17045521047_2776f26ed6_o.png "lesterchan.net Response Times (HHVM)")

**Installing HHVM**

> `$ apt-get install software-properties-common<br></br>$ apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449<br></br>$ add-apt-repository 'deb http://dl.hhvm.com/ubuntu trusty main'<br></br>$ apt-get update<br></br>$ apt-get install hhvm`

## nginx’s HHVM config (hhvm.conf)

## HHVM config (server.ini)

I am running HHVM through a file socket. > `hhvm.server.type = fastcgi<br></br>hhvm.server.file_socket=/var/run/hhvm/server.sock`

Previously, I can’t install HHVM because my VM is on the 32bit version of Ubuntu 14.04.2 LTS (Trusty Tahr). HHVM only supports 64bit machines.