Feeds

Facebook re-write takes PHP to an enterprise past

Remember C++? They do

3 Big data security analytics techniques

Facebook's re-written PHP to transform the dynamic language for fast performance on web-scale server farms without adding additional hardware.

The site's engineers have announced HipHop, which turns the popular and dynamic PHP code into highly optimized but static C++ and then compiles it using the GNU C++ compiler, g++. The change has been released to the community under the PHP license, and you can read more here.

It's quite a change for a social network site that's a posterchild for the Web 2.0 revolution and online services, built on the new generation of scripting languages such as PHP and Agile development methodology of hacking code for short project cycles.

C++ is traditionally associated with the reliable - but relatively unexciting - world of enterprise and server-side computing.

And, while Facebook announced HipHop on Tuesday, the truth is it's already completely committed to the architecture: HipHop's been running on Facebook's thousands of servers for the last six months, with 90 per cent of the site's traffic now running through the transformed PHP.

The company claimed it's cut the CPU use on its servers by up to 50 per cent, depending on the page thanks to HipHop's transformation of PHP.

David Recordon, Facebook's senior open programs manager, told The Reg this translates into cost savings as the company can manage its existing server farms while also adding additional traffic to its service. "We can scale the site in active users and face views and can get more from current hardware without buying more servers," Recordon said.

HipHop started as a skunkworks project two years ago as Facebook realized in 2007 it needed to make some fundamental change to its server architecture if it was to keep growing while avoiding the cost - and systems management pain - of simply adding more servers to its already large server farm. Among the options under discussion were re-writing the site in a completely different language, optimize the Zend PHP engine it uses from Zend Technologies, or work on PHP caching in the applications server

Facebook ruled out a language re-write as it would never be able to keep up while engineers did submit changes to the Zend engine, but the changes didn't go far enough Recordon said.

The plan for HipHop now is to support PHP 5.3 in the next few months - it's currently on version 5.2. Aside from that, Recordon said Facebook wants community feedback.

He noted HipHop would not create a fork in the PHP community, as HipHop would only be of interest to a narrow section of users - those, like Facebook, running very large sites. He said Facebook wanted to "minimize" the differences between PHP and HipHop.

"HipHop makes sense at our scale, but not for everyone," Recordon said. "Most people will continue using PHP today." ®

SANS - Survey on application security programs

More from The Register

next story
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Oh no, Joe: WinPhone users already griping over 8.1 mega-update
Hang on. Which bit of Developer Preview don't you understand?
Microsoft lobs pre-release Windows Phone 8.1 at devs who dare
App makers can load it before anyone else, but if they do they're stuck with it
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Internet-of-stuff startup dumps NoSQL for ... SQL?
NoSQL taste great at first but lacks proper nutrients, says startup cloud whiz
Ditch the sync, paddle in the Streem: Upstart offers syncless sharing
Upload, delete and carry on sharing afterwards?
New Facebook phone app allows you to stalk your mates
Nearby Friends feature goes live in a few weeks
Microsoft TIER SMEAR changes app prices whether devs ask or not
Some go up, some go down, Redmond goes silent
Batten down the hatches, Ubuntu 14.04 LTS due in TWO DAYS
Admins dab straining server brows in advance of Trusty Tahr's long-term support landing
prev story

Whitepapers

SANS - Survey on application security programs
In this whitepaper learn about the state of application security programs and practices of 488 surveyed respondents, and discover how mature and effective these programs are.
Combat fraud and increase customer satisfaction
Based on their experience using HP ArcSight Enterprise Security Manager for IT security operations, Finansbank moved to HP ArcSight ESM for fraud management.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Top three mobile application threats
Learn about three of the top mobile application security threats facing businesses today and recommendations on how to mitigate the risk.
3 Big data security analytics techniques
Applying these Big Data security analytics techniques can help you make your business safer by detecting attacks early, before significant damage is done.