I’m here at the Facebook Technology Tasting, where the social network is showcasing their newly open sourced PHP technology, HipHop. The new technology effectively transforms PHP into C++, resulting in a significant savings of CPU cycles on web servers. Facebook is streaming the event live, and we’ve embedded the live stream below.
Facebook Senior Open Programs Manager David Recordon kicked off the event by walking the audience through some of the challenges Facebook faces, particularly with the dynamic pages it has to generate. He spoke about some of the benefits of various programming languages, and also the CPU costs of each. As it scaled, Facebook encountered problems with PHP, including high CPU and memory costs and difficulty developers faced to build extensions. But Facebook has a slew of talented PHP developers, and it didn’t make sense to rewrite the site.
The solution Facebook came up with is HipHop for PHP, which started as a hackathon project from a single developer named Haiping Zhao (though he had some team members as the project progressed). The technology transforms PHP into C++, using g++ to compile it.
Facebook has found that the technology uses 50% less CPU with equal traffic on its web tier, and 30% less CPU usage with doubled traffic on its API tier.
Facebook started deploying HipHop six months ago (initially it was only on internal servers). It’s now been ramped up to 90% of Facebook’s production servers.
Zhao took the stage to give a highly technical walkthrough of the benefits of the technology (watch the video below for the details).
Facebook Open Source Developer Advocate Scott MacVicar presented a roadmap for the future of the open source project. Among Facebook’s goals:
-Catch up with PHP 5.3
-Support Apache as a web server option
-Evolve based on usage outside of FB.