How I built a zero energy cost, zero carbon home server
Running an internet biz on sunshine and *nix
How do you make the electricity bill for your home computing disappear? I decided to try to find out.
Historically computer kit had been responsible for about 90 per cent of our electricity bill at my home office for my ISP and consultancy business. I ran one of the UK’s first ISPs, and even in my new, smaller home, I was getting a bill of £1,000 a year.
In late 2007 I caught the energy-efficiency (and climate-change) bug. I had become worried by equipment that was overheating in summer, and anyway we needed the space for another child on the way in 2008.
The two rounds of therapy I describe here almost entirely eliminated that bill; my annual business 'leccy use at home now probably costs less than one purple drinking voucher, ie £20, and it is practically invisible. I also got a room back without moving or building an extension.
Do your homework first
You need to measure to manage. A simple plug-in power meter showed that all the servers used well over 600W, with the networking drawing another 40W. That didn't include the air-con that I needed in summer to keep it all from melting.
Monitoring the servers confirmed that none of them was then heavily loaded for CPU, I/O, or any other parameter.
All I needed now was essentially a small home office (SoHo) style-server, and *nix being what it is, consolidating all of the functions on to a single machine was not going to be too tricky. None of my main applications were tied to a particular machine architecture or OS – eg sendmail, Web servers including a big Java/JSP site, and DNS.
In megacorps, especially on Windows boxes, it can be very helpful to virtualise servers so that they still think that they have the whole machine to themselves, but with my relatively well-behaved apps that wasn't necessary.
Bringing everything to one box also would also eliminate the need to run a complex internal network.
So, in the first round of consolidation, I brought all the applications onto a single laptop running Linux, with a few GB of memory. This consumed somewhat under 30W on average, as little as 17W when quiet.
Some of the apps, especially the Java Web server, had to be reined in a little, especially with regards to memory and disc usage, and storage has proven to be the most tricky recurring themes in this downsizing story.
Various techniques were used to trim power consumption. I'll describe them in detail below.
I minimised filesystem activity by turning off pointless logging. I used solid-state storage, spinning up a magnetic disc only occasionally. I turned on "laptop mode" to minimise disc spin-ups. I used a "tickless" Linux kernel and using the "ondemand" CPU speed governor. I also made sure that apps let the CPU sleep as much as possible.
I also spent time with the devices - autosuspending as many devices as possible. The major applications – such as Apache, sendmail, NTP, etc – were tuned for CPU efficiency, and any necessary applications and hardware (eg the backlight and WiFi) were disabled. The networking was simplified to reduce consumption to 8W for one ADSL router. The upshot of this part of the story is that it all worked. It also saved the cost of the new equipment in electricity in the first year and every year since. These are the kind of savings that both a bean-counter and a tree-hugger will love (over 6MWh per year of electricity saved and 3 tonnes of CO2 emissions) [The Advertising Standards Authority says that you can only claim 430 grammes of CO2 per kilowatt-hour. Try 2.58 tonnes - Ed]. Indeed the power consumption was so dramatically reduced that I could run the server off a solar panel in my back garden up to 12 hours per day.
Interested in the gruesome details?
Storage, storage, storage
I expected that memory might be an issue, but a bit of tweaking of configuration of sendmail (maximum simultaneous incoming connections) and Apache and my big Java app overcame most of that fairly easily at this stage.
Having less storage available after moving away from big networked RAID discs was more of a problem. In the end it turned out that I didn't need to keep years' worth of logs for possible analysis on my death-bed for example. But it did take quite a lot of admin time and soul-searching to discard them.
Also, I set the system up to try to boot and run from solid-state media as much as possible to minimise power consumption (an SD card for the laptop), with the hard disc only spun up when necessary for "bulk" storage.
This brought up a feature of excessive write to storage in particular: such writes might prematurely wear out the SD card.
So a significant amount of effort went into reducing unnecessary logging and writing without losing anything essential if the system went down. For the laptop, forcing "laptop mode" most of the time was very helpful. And making sure that /tmp was in tmpfs, ie RAM, was also good.
Next page: Java is not enough: introducing Sheeva
Although the energy-saving tech might look cool, your biggest no-brainer was replacing 600W of various unnecessary equipment with a laptop. The biggest advantage of that is, of course, battery backup but if you have 600W of equipment doing what a bog-standard laptop could do in the first place it means you weren't keeping a check on your servers anyway. You admit yourself that most of them sat idle which suggests that, at the point of purchase, these machines were unnecessary and probably quite expensive. If your previous equipment had been strung out, then sure - upgrading to a more powerful but more energy efficient machine makes sense but you could have *always* done this.
You don't have computers to sit idle unless they are there purely for redundancy purposes, at which point you HOPE they never do anything else but sit idle and you can't gain that redundancy any other way.
The rest of the article seems a bit pointless - 30W is more than low enough to come into the "electrical noise" or even "cable loss" category of any modern home (£3 a month-ish? £30 a year?) and every optimisation you made after that was actually costing MORE in terms of materials, production, configuration, shipping, etc. The K8055 is also overkill for a simple monitoring task though I have used them a lot myself.
And, at the end of the day, you could have done this in 2001 for the same saving. Mini-ITX VIA EPIA pull only a handful of watts (an in-car PC I built takes only 7W in full operation, including a K8055, internal drive and various USB gadgets) and does 600MHz (or 1Ghz) on x86 even on the older models - the model I use was actually one of the original boards that a school I work for was throwing out, originally specced as a Linux thin-client. They don't need fans, last forever, take standard PC hardware, are compact and pull about the same as the SheevaPlug - they also benefit from having LOTS of ports including good old fashioned RS232. Sure, the Sheeva's a nice gadget but it's nothing spectacular. Go look at the latest GumStix, for instance.
Personally, I think you'd have been better off with a couple of mini-ITX's (lot cheaper and more standardised to replace in the long run, and you could even move down to nano-ITX etc. as they start to pack more in), or possibly just a decent laptop from the start. In the long run, the prices you spend on things would have been better diverted to basic hardware and more power generation - a couple of 60W panels would happily run a bog-standard mini-ITX board with a normal laptop hard drive for ages and no having to worry about tuning the system.
I think it's just a "boy's toy" project rather than something practical. If you want "zero energy", there are much better ways of doing it without having to buy new, state-of-the-art hardware and tweaking incessantly.
that a single core Xeon with 512 MB memory was considered a full-blown server not so many years ago. I think a key lesson is that tweaking the apps allows much more efficient memory use. Programmers (embedded systems' guys excepted) have become lazy about memory use, due to its low cost. This is why we need the equivalent specs of a Cray Y-MP to run the latest incarnation of Office (check the recommended system specs).
As Niklaus Wirth said: "Software is getting slower faster than hardware is getting faster"
Is it me?
"I became so worried about using a little electricity that, I continued to contribute to over-population"...