Has reduced the site's server load by 50 percent.
Haiping Zhao, an experienced server engineer at Facebook, announced yesterday in this blog post that the site once done in-house developed software available as open source.
This time we are talking about HipHop for PHP, a solution that makes the PHP-based script code to the optimization C + +. C + + code is done then on to the binary code with the widespread compiler g + +.
Zhao says that PHP is a language that is easy to learn and use, and that it contributes to that Facebook can innovate quickly. But at the same time the social network needs for solutions that scale better than PHP is capable of. With 400 billion PHP-based page views a month, this is indicated.
- To scale the Facebook is particularly challenging because almost every page view is made by a logged in user with customized user experience. When you visit your home, we have to look up all your waters, ask for their most relevant updates, filter the results based on your privacy settings, to then fill the stories with comments, pictures, "like" and all the rich data people love about Facebook. All this in under a second, writes Zhao.
Transformation process carried out by Facebook HipHop for PHP. (Illustration: Facebook)
- HipHop let us write the logic that performs the final thing together in PHP, and iteration it quickly, while we base our on tailored support in C + +, Erlang, Java or Python to service news feed, search, instant messaging and other core components of the site.
Zhao mentions a number of other ways to optimize your PHP-based services, including various caching techniques, opcode-optimization, PHP compilation and transformation of C, Java and. Net.
- The advantage of HipHop is that it is almost transparent in relation to our development speed, writes Zhao.
It's not out of your blog post to Zhao, but HipHop is also a separate Web server. This means that the solution can not be used with, for example, Apache HTTP Server.
- Apache is generally a great Web server, but when we look for ways to get the next half or whole the percentage of performance, we do not need all the functionality that Apache offers, "said Facebook chief of Open Source Software, David Recordon, the Developer. com.
He adds that he hopes there will emerge an open source project a day that will get HipHop to work with the Apache HTTP Server.
Facebook has taken HipHop gradually in use the last six months. Today comes more than 90 percent of Facebook traffic with the help of HipHop.
More information about HipHop for PHP is available on this page, but GIT-page where the code is to be made available, are not opened yet.