Feeds

Facebook re-write takes PHP to an enterprise past

Remember C++? They do

Business security measures using SSL

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." ®

New hybrid storage solutions

More from The Register

next story
'Windows 9' LEAK: Microsoft's playing catchup with Linux
Multiple desktops and live tiles in restored Start button star in new vids
New 'Cosmos' browser surfs the net by TXT alone
No data plan? No WiFi? No worries ... except sluggish download speed
iOS 8 release: WebGL now runs everywhere. Hurrah for 3D graphics!
HTML 5's pretty neat ... when your browser supports it
Mathematica hits the Web
Wolfram embraces the cloud, promies private cloud cut of its number-cruncher
NHS grows a NoSQL backbone and rips out its Oracle Spine
Open source? In the government? Ha ha! What, wait ...?
Google extends app refund window to two hours
You now have 120 minutes to finish that game instead of 15
Intel: Hey, enterprises, drop everything and DO HADOOP
Big Data analytics projected to run on more servers than any other app
SUSE Linux owner Attachmate gobbled by Micro Focus for $2.3bn
Merger will lead to mainframe and COBOL powerhouse
iOS 8 Healthkit gets a bug SO Apple KILLS it. That's real healthcare!
Not fit for purpose on day of launch, says Cupertino
prev story

Whitepapers

Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.
WIN a very cool portable ZX Spectrum
Win a one-off portable Spectrum built by legendary hardware hacker Ben Heck
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Security and trust: The backbone of doing business over the internet
Explores the current state of website security and the contributions Symantec is making to help organizations protect critical data and build trust with customers.