CIO

HipHop steals Web serving from Apache at Facebook

Facebook is moving its main Web serving infrastructure from Apache to HipHop for PHP, which has its own embedded Web server.

Despite using the venerable LAMP (Linux Apache MySQL PHP) stack to build one of the busiest sites on the Internet, Facebook is moving its main Web serving infrastructure from Apache to HipHop for PHP, which has its own embedded Web server.

Facebook’s senior open programs manager David Recordon said HipHop for PHP has a simple Web server than can be used as alternative to Apache.

“We’ve generally been using Apache with PHP, but HipHop has its own embedded Web server, which is a really simple Web server built on top of libevent. And so now we have been moving to using that,” Recordon said.

The news comes days after Facebook announced HipHop for PHP, a tool for transforming PHP code into optimised C++ to improve the performance of its PHP application base.

[See this feature article -- Open source helps Facebook achieve massive app scalability and slideshow -- for a more extensive look at how Facebook deploys open source software]

Recordon didn’t give any indication of how many Apache Web servers have been replaced with HipHop for PHP, nor did he elaborate on the motive for the shift, but Facebook is big on speed and performance, so it's likely those factors have something to do with the decision.

According to HipHop for PHP developer Haiping Zhao, Facebook is now serving more than 90 per cent of its Web traffic using HipHop, only six months after deployment.

[See the Facebook developer blog for a technical overview of HipHop for PHP.]

In addition to Apache and HipHop for PHP, Facebook is also using another Web server, dubbed Tornado, for real-time data processing which it released as an open source project in September last year.

Earlier this year, the Apache maintainers considered ending new releases of the older 1.3 series in favour of the current 2.2 series.

Whether HipHop for PHP’s “simple” Web server will be adopted by other popular Internet portals like Facebook remains to be seen, but Apache has a rich ecosystem of extensions and continues to enjoy the top spot in Web server popularity.

Moreover, Apache’s wider use is increasing, according to Netcraft’s February 2010 Web Server Survey. Apache had the biggest change of the month with hostname instances increasing by 1.6 million.

Apache hosts about 113 million domains, or 54.46 per cent of the total domains on the Internet. HipHop for PHP running on thousands of servers at Facebook still has a way to go yet.