Going Forward, Faster with HHVM

A few months ago, we began the process of rolling out HipHop Virtual Machine (HHVM) to our servers. After hitting a few bumps in the road, we're excited to announce that 100% of our PHP servers are now operate on HHVM! This represents a huge milestone for us, as virtually all requests to Box pass through our PHP application at some point. As a result, almost everything on the site has seen a dramatic speed up while simultaneously receiving a cut in overall CPU utilization on our servers. HHVM already contributes massively to our performance, and we expect it to continue to minimize our server costs moving forward. To really understand the impact this will have on Box, it's best to take a look at some of the numbers resulting from this effort.

Taking a look at our site-wide metrics, we can see that we're getting through the server-side response time of all requests about 2x faster across the board.

As you can see, rolling out HHVM produced immediate results for our users across the board. Our slowest requests on HHVM (90th percentile) are now completing as fast as our median response time in Apache/Zend based PHP. Our fastest requests have become even faster, improving from about a 200ms response time to around 90ms.

Clients of the Content API receive the additional benefit of increasing throughput for clients that block waiting for a response from the server. The Box Sync client is a really great example of this. When syncing a large number of small files (around 100kB each), most of the request time is spent processing in the server. HHVM has improved our median server side latency for uploads of this size 2x. This results in a substantial increase in throughput from our Sync client This benefit applies to other clients as well, such as the bulk uploader in the main webapp and our mobile clients.

Looking past the latency benefit, HHVM also comes with a huge cost benefit for us right out of the gate! Since the completion of the migration, the overall CPU utilization on servers running Box's PHP application has been cut in half.

HHVM CPU usage

In the near term, this buys us enough server capacity to not have to expand these clusters for roughly an entire year! Also, we will continue to reap the benefits of these savings due to slower growth-rate in the CPU cost of running the application. This makes our PHP application substantially more cost effective.

Next, we'll be working to upgrade our HHVM deployment to the latest version, and contribute enhancements we make to HHVM to the community. This effort, in combination with another effort to migrate our deployment to use Repo Authoritative mode, should come with even greater performance benefits and help us deliver an even better customer experience. We're also interested in exploring the possibility of converting our PHP application to use the Hack language, in hopes of providing greater application safety and developer agility by leveraging features like Hack's native type system. HHVM is an extremely promising platform for us, and we're excited to be working with the open source community to continue to improve it!

Learn more about Box on HHVM at Skippy's lightning talk at Box Dev on April 22!