Can HipHop Help The Planet?


By now, you might have heard the details of HipHop, Facebook’s PHP-to-C++ convertor that was announced yesterday.  Like most of you, I’m eagerly awaiting the release of the code so that I can play with it and learn in detail what it can do and what it can’t.  For now, Marco’s post seems to have the most technical information in it so far.

I’m with Sebastian on this one. Whether or not you think Facebook’s HipHop is relevant to you, I think they deserve credit for having shared their particular solution with the wider community.  (They’ll get extra credit when they actually release some code :) ) After all, they’ve built on top of open-source in the first place; giving something back to the community is part and parcel of being a good member of the community.

How many of you earn your living from open-source, but have never contributed anything back?

But that isn’t really what I want to blog about today.

I’ve been following the chat on Twitter about HipHop, and I think all the nay sayers have been overlooking an important point.  HipHop has the potential to reduce the amount of power consumed in running a website.  And surely that can only be a good thing for all of us?

If you don’t run your own servers in a data centre (for example you use a virtual server, or host on a shared hosting solution), then perhaps you might not be aware that the power required by each server in a rack is often a major factor in the overall cost of running the servers.  Whether or not you believe in climate change, energy prices are on the rise.  Whether or not you believe in peak oil, oil and natural gas supply issues are forecast to push energy prices up further.  Taking steps to get more work done per unit of power consumed has been the focus of hardware manufacturers for several years now.  Isn’t it time it also was the focus of the software community too?

CPU usage is only one aspect of the total power consumed by a server in a rack, but in my experience people tend to add more servers to their solution primarily because they need more CPUs running their web servers to handle more traffic.  A reduction in the number of CPUs required will translate into a reduction of the number of servers required … which means a reduction in the amount of energy being consumed.

How can that not be a good thing, if it can be achieved?

I know the answer will be that PHP apps are not CPU-bound, that they spend much of their time waiting for results from the database.  That might be true if you’re measuring a PHP app from the point of view of elapsed time, but what if you’re measuring the PHP app in terms of CPU cycles consumed?  Every single PHP script has to run on a CPU, and has to get to the point where it’s sat waiting for the database.  If HipHop means that each PHP script uses less CPU to get to the same point, that has to be a step in the right direction.

Until we can play with HipHop ourselves, it’s impossible to say whether it saves enough CPU cycles to allow us to use less CPUs and therefore less servers.  Remember, you’ve still got the overhead of your operating system and web server to factor into the equation.  And then there’s the energy cost of compiling your code in the first place during development; for seldom-visited websites, HipHop may increase overall energy requirements.

But it sure is nice to hope, isn’t it?

TechniqueNW 10


Whilst everyone else was over at PHP Benelux 10 (which sounded like a great conference according to the Twitter feedback!), I was up in Morecambe, at the Technique|NorthWest training event organised by Northwest Vision and Media and run by The White Room.  A huge thanks to Paul Collins for inviting me up at the last minute to run the PHP workshop on the Saturday, and I’d love to be involved in further events like this.

I had a great time at the event, and I was delighted to see how the North West of England is trying to build and support a digital economy, instead of simply leaving it to chance.  If only South Wales had such an initiative!

Perhaps the most interesting thing I took from the weekend was the large disconnect between the people who attended and many of my friends on Twitter.  If you listen to the Twitterarti, you’d think that Adobe Flash is a technology that has run its course and is now in terminal decline (mostly because the iPhone and iPad do not support it, plus Adobe not seen as exactly a bastion of innovation these days).  And yet, by far the most popular workshop at Technique|NorthWest was the Flash workshop.  To these people, Flash is not only still relevant, but in their industry it is still the only real option for delivering online advertising campaigns.

Food for thought.

PS: I also took some photos of Morecambe before the Saturday workshops started.

Welcome To My Blog

My passions are for good management, Linux (Gentoo Linux is my preference), web-based applications (and PHP in particular), as well as photography, walking, and Tai Chi Ch'uan.

There's a longer bio available on my homepage.

Invest In Loss

Invest In Loss is a philosophy of good management, based around the three core principles of Direction, Organisation and Supervision, which I've been developing since the 90's.

PHP

I've been programming in PHP since 1999. I've contributed articles to php|architect magazine, spoken at the php|cruise conference in 2004 (where I was voted Best Speaker), and co-authored the official Study Guide for the Zend PHP 4 Certification Exam.

Gentoo Linux

For three years, I led Gentoo's work on supporting web servers and web-based applications, as well as work on support for NoMachine's NX technology. I've left Gentoo to develop a packaged LAMP Server release based on Gentoo.

Photography

One of the nice things about being married to an artist is the encouragement and coaching I get on my photography. Combine that with living very close to the Brecon Beacons, and when the weather's good, you can find me wandering the hills of South Wales with my beloved Nikon and Canon cameras.

My current photography project is Merthyr Road, an investigation of both the old and the new along the route from Cardiff to Merthyr Tydfil.

Tai Chi

I went to my first Tai Chi class because my wife didn't want to go there alone ... now I'm teaching a class of my own! How exactly did that happen? :) I'm interested in the deeper understanding and applications of this fantastic art, and especially in how we can improve the way Tai Chi is taught so that the health benefits can be enjoyed by anyone and everyone.

Personal Stuff

If you're still reading at this point :), I also keep a general (and somewhat disorganised) personal blog too, aimed more at friends and family.