Feeds

Facebook re-write takes PHP to an enterprise past

Remember C++? They do

Intelligent flash storage arrays

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

Top 5 reasons to deploy VMware with Tegile

More from The Register

next story
Preview redux: Microsoft ships new Windows 10 build with 7,000 changes
Latest bleeding-edge bits borrow Action Center from Windows Phone
Google opens Inbox – email for people too thick to handle email
Print this article out and give it to someone tech-y if you get stuck
Microsoft promises Windows 10 will mean two-factor auth for all
Sneak peek at security features Redmond's baking into new OS
UNIX greybeards threaten Debian fork over systemd plan
'Veteran Unix Admins' fear desktop emphasis is betraying open source
Entity Framework goes 'code first' as Microsoft pulls visual design tool
Visual Studio database diagramming's out the window
Google+ goes TITSUP. But WHO knew? How long? Anyone ... Hello ...
Wobbly Gmail, Contacts, Calendar on the other hand ...
DEATH by PowerPoint: Microsoft warns of 0-day attack hidden in slides
Might put out patch in update, might chuck it out sooner
Redmond top man Satya Nadella: 'Microsoft LOVES Linux'
Open-source 'love' fairly runneth over at cloud event
prev story

Whitepapers

Choosing cloud Backup services
Demystify how you can address your data protection needs in your small- to medium-sized business and select the best online backup service to meet your needs.
Forging a new future with identity relationship management
Learn about ForgeRock's next generation IRM platform and how it is designed to empower CEOS's and enterprises to engage with consumers.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.