Feeds

Facebook re-write takes PHP to an enterprise past

Remember C++? They do

Providing a secure and efficient Helpdesk

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

Secure remote control for conventional and virtual desktops

More from The Register

next story
Not appy with your Chromebook? Well now it can run Android apps
Google offers beta of tricky OS-inside-OS tech
New 'Cosmos' browser surfs the net by TXT alone
No data plan? No WiFi? No worries ... except sluggish download speed
Greater dev access to iOS 8 will put us AT RISK from HACKERS
Knocking holes in Apple's walled garden could backfire, says securo-chap
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
prev story

Whitepapers

Secure remote control for conventional and virtual desktops
Balancing user privacy and privileged access, in accordance with compliance frameworks and legislation. Evaluating any potential remote control choice.
Saudi Petroleum chooses Tegile storage solution
A storage solution that addresses company growth and performance for business-critical applications of caseware archive and search along with other key operational systems.
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 for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
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.