Friday, March 7th, 2008

How green is your Web site?

Category: Performance

<p>Steve Souders, the Web performance chap, has been inspired to calculate how green your website is based on the correlation between fast pages and energy:

Intrigued by an article on Radar about co2stats.com, I looked at my web performance best practices from the perspective of power consumption and CO2 emissions. YSlow grades web pages according to how well they follow these best practices. What if it could convert those grades into kilowatt-hours and pounds of CO2?

Let’s look at one performance rule on one site. Wikipedia is one of the top ten sites in the world (#9 according to Alexa). I love Wikipedia. I use it almost every day. Unfortunately, it has thirteen images in the front page that don’t have a far future Expires header (Rule 3). Every time someone revisits this page the browser has to make thirteen HTTP requests to the Wikipedia server to check if these images are still usable, even though these images haven’t changed in over seven months on average. A better way to handle this would be for Wikipedia to put a version number in the image’s URL and change the version number whenever the image changes. Doing this would allow them to tell the browser to cache the image for a year or more (using a far future Expires or Cache-Control header). Not only would this make the page load faster, it would also help the environment. Let’s try to estimate how much.

  • Let’s assume Wikipedia does 100 million page views/day. (I’ve seen estimates that are over 200 million/day.)
  • Assume 80% of those page views are done with a primed cache (based on Yahoo!’s browser cache statistics). We’re down to 80M page views/day.
  • Assume 10%, no, 5% of those are for the home page. We’re down to 4M page views/day for the home page with a primed cache. Each of those contains 13 HTTP requests to validate the images, for a total of 52M image validation requests/day.
  • Assume one web server can handle 100 of these requests/second, or 8.6M requests/day. that’s six web servers running full tilt year-round to handle this traffic.
  • Assume a fully loaded server uses 100W. Six servers, year-round, consume 5,000 kilowatt-hours per year or approximately 500-1000 pounds of CO2 emissions.

Wow, even more pressure for you to not be sloppy with your apps. Who knows if Green Peace will be using YSlow to find culprites and start boycotts because of it ;)

NOTE: Steve is co-chair of the O’Reilly Velocity conference which is taking place on June 23-24.

Related Content:

Posted by Dion Almaer at 6:58 am
13 Comments

++---
2.6 rating from 38 votes

13 Comments »

Comments feed TrackBack URI

This is the most retarted idea I’ve ever heard.

To start with count the number of times the word “Assume” is used.

Secondly the CPU cycles serving http requests are going to be dwarfed by the CPU of the database queries.

Thirdly the web site is penalised for the number of users, they need to take the average number of http requests across all pages not multiply the front page by number of users.

Fourthly it assumes constant efficiency in terms of both power and CPU across wildly disparate hardware / and software platforms. Does windows / IIS on commodity hardware consume more power serving a http request than apache running on a pSeries? The answer is very probably.

Its obvious as the number of requests goes up, the number of servers required goes up and the carbon footprint / energy consumption will go up but there is no assumption that it will necesarily follow a strictly proportional relationship, and there is no way to even roughly determine the magnitude of power / carbon used.

Comment by Dave Crighton — March 7, 2008

Well, regardless of the details, you can’t argue against good web efficiency. Every little bit counts….

Comment by chrismarx — March 7, 2008

Let’s make all the backgrounds black too.

Comment by Jonathan Leech — March 7, 2008

“Let’s make all the backgrounds black too.”

People have, seriously, advanced this idea before. Besides the fact that it’s completely ridiculous, black backgrounds consume more energy on LCDs anyway.

People, environmentalism isn’t about expending vast resources making basically immeasurable improvements to resource usage in a context of utterly unacceptable resource usage overall. Ending the rape of the planet is going to require huge, tremendous, world-changing systematic changes to the way humans operate—not just in their own personal lifestyles, but culturally and economically. Most of the environmental problems we face are not lifestyle issues in the first place: they’re either cultural (assumptions about scarcity and about things like limitless growth) or commercial.

In terms of measurable improvements, if we are to keep computers around at all, they’d need to be manufactured using only already-mined (low-energy recycled) materials and be able to rely only on solar power. And we’d have to find ways to reuse existing devices, rather than throwing them away or “recycling” them (which, basically, amounts to throwing them away in dumps in Asia instead of in the US).

Comment by Trevor — March 7, 2008

sorry about the tag guys, thought I caught them all. Maybe one day, we’ll have inline previews (hint)…

Comment by Charles — March 7, 2008

The primary driver for successful long term environmental change has never once been individual concern for the earth. Productivity efficiency is the only successful long term environmental change agent. Businesses like Anheuser Bush recycle because it saves them money, people recycle because it pays them money. Corporate Headquarters host natural outdoor campus’, as opposed to seas of concrete, because it attracts and retains better workers etc…

Your proposal might be fruitful if it was framed as a more productive alternative (less servers, fewer server admins, less complexity, faster response times).

That and CO2 being a pollutant is a farce.

Comment by Chris Phillips — March 7, 2008

@Chris: uh, recycling has never paid me any money, and I’ve always done it regardless of location or requirement. So has my family, and so have most of my friends.
.
“Less servers” and “Faster response times” ? From the post example:

Assume one web server can handle 100 of these requests/second, or 8.6M requests/day. that’s six web servers running full tilt year-round to handle this traffic.

So yes, being efficient (in this case with caching) results in less servers, faster response times, and therefore money savings — lower bandwidth means fewer servers, and fewer servers means fewer admins.
.
As for your CO2 trolling, producing energy can pollute in many other ways: material costs, mining and erosion damage, nuclear waste… too many to list. So it’s always better to be efficient.

Comment by Charles — March 7, 2008

@tj: If you’ve ever tried to quit smoking, that’s how it starts. And then if you stick to your guns, eventually you’ll be at 0 cigarettes. (This is from personal experience, believe me.) Every bit makes a difference.

Comment by Charles — March 7, 2008

Oh No!! We’re still developing cars that do +200mph – but our wesites have to be green.. whatever next!

(fascinating article though) :-)

Comment by Advertising — March 7, 2008

Uh oh, I better switch to Telnet, I fear for my grandchildren….. Hell, I better throw that Xbox in the trash too and only play Text based games.

I can see it now, type in http://www.google.com and search for something, you then get a pop up saying: “You’re request could not be completed, you have exceeded your daily emission rating for internet usage. Please try again after 24 hours”

Comment by TNO — March 7, 2008

What a pant load. Seriously, I thought we were going to turn a corner with all this nonsense about CO2 emissions and carbon footprints, but now this movement is targeting web design? Even if I were to concede to the flawed logic that makes CO2 the ultimate scapegoat in global warming (which requires ignoring the lack of real data we have on water vapor and solar output) the assumed numbers posted above from the Wikipedia study only illustrates the absurdity of this idea. 1 ton of carbon over a year based on 100-200 Million visits a day would translate to about 10 pounds or less of CO2 each year to most web developers. Trying to reduce a digital “carbon overhead” is a waste of time, energy (requires more time at your desk “fixing” this “problem”) and resources. You’d be better off not pulling the weeds in your garden and let them scrub the CO2 from the air your nasty server spits out each calendar year.

Comment by Sean Foushee — March 8, 2008

I recommend the book Cool It by Bjørn Lomborg.
He does not deny global warming is real, or that it is man-made, but does argue that much of the hype and fervour about optimizing insignificant causes of pollution is wasted energy.

I would tend to think that optimizing websites (for carbon emissions reasons) has bugger all benefit to the environment.

Comment by mike08 — March 9, 2008

I agree with just about every post here: this is all a bunch of bullshit.

I mean, I totally agree that we should optimize our websites so as not to waste money and resources, but to use global warming as motivation? A couple servers sitting in an office will not affect global warming, and removing them will not stop it. I don’t care how you do the math, stop and use some common sense for a secon. These little things don’t matter. You aren’t going to stop global warming, especially not with a website. You could stop using any kind of electricity for a year and it would do absolutely nothing.

I personally believe the whole “global warming” commotion is crap. Even if we could stop it, we would have to tackle it on a national level, and even then, countries like China are emitting a lot more than the US.

Comment by musicfreak — March 10, 2008

Leave a comment

You must be logged in to post a comment.