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