Tectonic is now closed. No new posts will be added to the site, but the site is maintained here as a reference. If you need to contact me you can email me or find me on Twitter

Linux services without mains power

By stevan | March 10, 2009

Originally from Cape Town, Stevan Lockhart now lives in the north west of Scotland in a house that is off the electricity grid. Using a wind generator, some solar panels and free and open source software he and his wife both run their businesses off just 20W of power. Here Stevan explains the software and hardware decisions that made this lifestyle possible.

We live in the north west of Scotland, in the crofting area of Assynt. From here my wife runs her hand-dyed yarn business and I run my small free software consultancy as well as “attending” video conference lectures for my UHI Millennium Institute course. We bought the house about 12 years ago, and one of the appealing factors was that it was off the grid. I had always wanted a chance to see whether it was viable to operate without mains power, and here we were faced with either spending a fair amount on getting power to the house or looking at harnessing natural power. So we chose to install a wind generator with some solar panels to provide electric energy. We do, however, have telephone and broadband connections.

Assynt is a wonderful place to live, and it’s not surprising that my wife’s blog, which is ostensibly about knitting and crafts, also documents some of the beauty of the area, and the unusual things we cope with, such as rescuing a stranded lamb, and having on otter in our kitchen overnight.

The first critical issue when you win your power from the wind is to reduce your requirements. Our wind generator and solar panels charge a battery bank, from where inverters convert the power to conventional 230V AC from which point it is no different to any other household. A larger inverter is brought into operation when we need extra power, such as for running a vacuum cleaner or microwave, and a much smaller, 350W inverter, runs lights, hi-fi, television, battery charging for laptops, the broadband router and a Linux server. Running energy-saving light bulbs helps to reduce the power requirement, especially necessary in winter when it is dark at 3:30 and doesn’t get light until 9:30 in the morning. These days, LCD television sets can be reasonably efficient (but many sets are surprising power hogs – be careful when you choose). But the server needs to be on all the time and with us, excessive consumption isn’t a nice-to-have to add to your green credentials, it’s the difference between a depleted battery bank and not having to worry about enough power. The other services that are on all the time are the hi-fi on standby, the cordless telephone and the printer.

Hardware
These days, there is a wide choice of lower-power mainboards, but this was not the case a few years ago. At that time, the Via-based mini-ITX boards were a good option, though. Our server runs a Via Esther processor running at 1.2GHZ MHz. It is connected to a laptop-style 2.5″ 320GB SATA disk and 512MB of memory. The system runs off a 12v power supply via a standard 50w “brick” power supply. We run a Netgear WG834GT router with wireless, which helpfully also runs off a 12V supply. Theoretically, we can run the router and server directly from the battery bank, but the voltage on that fluctuates meaning voltage stabilisers would be necessary, so frankly, it’s easier to run a normal 230VAC environment. The router consumes 10w measured at the battery, and the server 12-18w. However, add the two together off a single power supply brick, and the inefficiencies of the transformers are reduced, so we run the two together, and the usual consumption is just 18w, rising to 22w when the server is working hard.

Those 20w of power provide the following services:

Broadband router

Wireless Access Point

Email, including anti-spam etc

File sharing

Printer sharing

Groupware (diary, address books, etc)

Music streaming

Weather station data collection and display

Database services (mysql, postgresql)

Nagios system monitoring

Remote Access VPN

Other intranet services like photo albums, pets health logs etc

Software Choices
With a relatively underpowered processor, as well as wanting to save CPU cycles, software choice is important. One of the beauties of free software, which is often portrayed as a drawback, is choice. There is no “right” way to do any given task, and your choice of software may well differ from mine yet be equally valid. That’s fine and correct in our world.

DistributionThe system runs Ubuntu 8.04 LTS. I wanted to run an apt-based distribution and the long term support options are relevant to clients, so felt I should run the same as I would install on other sites, though running Debian would have been just as valid. I ran Gentoo for a while, whose optimisations are great for this type of application, but you really need to be a full time sysadmin to achieve the same consistency as with a non-source-based distribution. Arch Linux is also tempting (I run that on my Asus eeepc with XFCE 4.6) but a little too leading edge for this server requirement, for my taste.

EmailThe system runs Postfix as the MTA. Exim would be a good option, but I’m used to Postfix now, and it has utilities like mailgraph which are great for showing email stats, spam, viruses and blocked connection attempts graphically. Usually I run this with amavis to wrap anti-virus and anti-spam, but amavis does use a reasonable amount of system resource. So I installed clamsmtp for anti-virus scanning and run spamassassin in daemon mode for spam clearup. Postfix uses Realtime Black Lists to reject the majority of spamming attempts, after which the mail is handed off to clamsmtp to check the mail for viruses and dodgy content (the Sanesecurity signatures are great for this) and then on to spamassassin for spam checking. Postfix drops the message if it is considered to be sufficiently spammy, or delivers it to the user’s spam folder if the spaminess is marginal.

Secure IMAP (IMAPS) only is used for client access, using Dovecot. Dovecot also provides the SASL mechanism for Postfix to authenticate SMTP sending via TLS. No unencrypted external access is available, though easy to add, of course. The version of dovecot in Ubuntu 8,04 does not include Dovecot’s sieve manager, so pysieved is used for this. This allows automatic clientpcontrolled filtering of mail and works well with the Groupware application.

File SharingIn a different environment, Samba could be used, but as we only run free software here, the server runs NFS. Nothing much to add here – it’s simple to set up and just works.

Printer sharingCUPS is the solution to this. With CUPS clients, the printer automatically appears to the clients without driver installation. We run a Canon Pixma IP6600D as our main printer which does duplex, is reasonably fast, and is great for pictures. With chipped, compatible cartridges, it is reasonably cheap to run. However, it hates being powered down and powered back up, and consumes a lot of ink in the process. We found, though, that in standby it used about 2w of power, so we simply leave it on, connected to the server for instant access. The printer is well supported by CUPS. Using Linux desktops, the ability to print multiple pages on a single A4 sheet, duplexed, saves both ink and paper.

Web server
The easy choice would be apache, of course. But lighttpd is an interesting alternative, is fast and requires little resource footprint. Configuration is straight forward. PHP is provided by fastcgi which, though perhaps frowned upon when you have an apache module option, works well in practice. Other CGI options are possible.

GroupwareeGroupware is our choice for this, running against a MySQL database. This provides a wide variety of groupware services, but the ones that are important to us are diary facilities, address books, the info log and we also use the client for remote access to our email. The email client is a pretty good one, and sieve scripts can be created and managed from here. It also supports SyncML, which allows corporate clients to sync PDAs and mobile phones easily.

We use the Lightning add-on to Thunderbird for calendar access on our laptops. This is stable enough for everyday use, though under an Ubuntu desktop, and possibly others, you must install the libstdc5 library to install the add-on.

Music StreamingThere are many options for this, but our requirements are simple. So the easy little edna service is fine for us. More recently we have tended to use direct access to the music directory via NFS from our clients running rhythmbox or amarok. The music is, of course, in ogg-vorbis format. Edna can also be hacked to stream video, but again, in our environment, network access is simpler.

Weather StationThis is a TFA-badged Irox system USB-connected to the server. The server runs the Weather Display command-line client and some scripts to view current weather via the web server. A recent addition, on realising that Weather Display produced a delimited output file that could be scavenged for data, was some rrd scripts to graph hourly, daily, weekly monthly and annual trends.

NagiosNagios monitors the system along with monit, and also monitors some third party systems on behalf of clients. This works well with lighttpd.

Remote AccessApart from certificate-based ssh access, clients use OpenVPN to gain full remote access to our network. The easy-rsa scripts that come with OpenVPN make it easy to manage client certificates, and the overhead is negligible in this context.

Other servicesWe’ve found useful utilities like elogd great for small web-based “databases” such as pet health logs and so on. When I was testing the weather station software, I ran a small Debian-based virtual machine under Qemu on the server too. Performance was by no means sparkling, but it was adequate for what I was doing.

ClientsAs would be expected in a techie’s household, we run a number of machines, including Asus eee PCs for convenience and low power consumption. My wife prefers the standard Xandros-based original software on eeegie, her Asus, but I prefer Arch Linux running the XFCE desktop on bumpkin, mine. For tasks needing a bigger screen, such as image manipulation on Helen’s blog, she uses an ancient IBM X22 running Xubuntu. I mostly use an almost-as-old IBM X31 with Ubuntu for my day-to-day requirements, including Ekiga for video conferenced UHI lectures. Interestingly, though musch larger and more powerful, the X31 uses about the same power as the little Asus eee pc’s.

ConclusionSo all in all, that’s a pretty full range of services running on just 20w of power. There are many other ways of delivering similar services, including the very frugal options provided by running services on a router, or small servers in an electrical plug. Yes, we could reduce that by choosing a different processor type, or get more CPU power for a similar electrical power consumption, but it’s not necessary to squeeze the last few watts from the system which will always be a compromise between power consumption, service quality and choice of services. I was reluctant to choose a non-x86 processor so that I could stay with similar systems to those clients would want, and also to demonstrate that running off grid power did not necessarily mean compromise in terms of service.

Stevan Lockhart was born and educated in Cape Town and has more than 20 years IT experience, from the early days of PC networking, the rise of the Internet and the change of computing from pure business tools to general purpose communication and collaboration platforms. Stevan also has more than 11 years’ experience in the deployment of free and open source software in a commercial environment. TNC Applied Technology provides consultancy on free and open source software infrastructures, as well as mentoring services to companies in the early stages of piloting and deploying free software servers and desktops.

[…] free and open source software he and his wife both run their businesses off just 20W of power. More here The system runs Ubuntu 8.04 LTS. I wanted to run an apt-based distribution and the long term […]

Ambleston Dack March 10th, 2009 @ 11:05 pm

Wow, this guy should be used as an advert for most corporations on the way to go with power consumption, simply breath taking and shows the power of Linux and open source (beat that M$)

@ Wogan, you should see where I live in the UK, just as beautiful and in the winter just as bleak and remote which takes your breath away with its simple beauty when you see the different weather systems come rolling in off the sea. Oh and we are on the power grid, but I sure would like to shake off that yoke

Thanks for that. In my experience of trying to market my consultancy services, few corporations are interested in power consumption and environmental issues if it means change. Hopefully this article demonstrates that you can still deliver excellent, scalable services and use little power.

@Ronald:
So sorry about the typo – 1.2GHz it is, Ffrugal as I am, I’ve not yet tried to underclock my old Sinclair QL.

S

Charl March 11th, 2009 @ 1:00 pm

Awesome stuff. Now it is time for us all to move into the mountains and work remotely

Zbigniew March 13th, 2009 @ 2:32 am

Off-topic: “Originally from Cape Town, now lives in the north west of Scotland”.

Really drastic change of climate, indeed. 😉

Simon March 13th, 2009 @ 5:51 am

it will be my guide to setup my home office . It saves me licenses fee, power comsumption and i dont have to experiment other services that don’t work.

Wladimir Mutel March 13th, 2009 @ 10:32 am

The most interesting would be to know about your power-generating infrastructure, not computing one. What was the initial investment in wind generator, solar panel, inverters ? How much kWh do you generate/consume per day/week/month/year ? What is the local rate for grid electricity kWh ? How soon do you expect to reach a break-even point ? How do you heat your house in colder seasons ? How do you keep your perishable food in warmer seasons ? What other external factors do you most depend on for your survival ? All of that would be an amazing story to hear from you.

Well, Tectonic is an IT and FLOSS web publication, and though I installed our energy system myself my skills are rather better in IT. Rather like reasons for using Free Software, though, there are different reasons for being off-grid, not all of which mean competing with or using the same metrics as conventional power – it helps to think differently, though, as the status quo in my view does not always represent best practice.

But I take your suggestion of writing up our systems more broadly than on my blog, and will look for an opportunity to do that. I hope the article was of some IT value to you anyway.

S

Petem March 13th, 2009 @ 3:20 pm

excellent.. !! very inspiring..!! i second wlandimir…. your energy infrastructure would make a great story in-itself… but your IT story is a great one… and one that can serve as a great guide to everyone..!!

GREAT JOB!!!

Victor March 14th, 2009 @ 2:42 am

Fascinating article Stevan! Before the Big Meltdown I was thinking of doing something similar (except relocating to South Spain rather than the extreme North of the British Isles… slightly different climate 😉 so it will be really interesting if you do manage to get round to describing your energy management systems. I’m also interested as to how you arrange the running of a tele-consultancy business. Well done, and hang in there!

Chris March 14th, 2009 @ 11:58 am

Very interesting.
I find it surprising that your server seems to have just one harddisk (no fault tolerance). You also don’t mention your backup solution, I suppose you do have one?

We use removable USB/Firewire disks for backup using rsync, as well as some local checkpoint backups of data, such as the MySQL data.

Fault tolerance is a matter of risk analysis. Our risk is fairly low, as it’ll not be disastrous to us to be without the system for the day if I had to rebuild the system from backups. But I agree, it would be ideal to throw in some software RAID. Again, the risk of disk failure versus the extra power is a matter of understanding the risk. And of course, there’s every chance of being alerted early as the smartd daemon runs on the box.

I too would be interested in the setup of the energy system e.g. how much of your energy do you get from solar, how much from wind, … I suppose there are no kids in your household, but have you thought of home automation and smart appliances?
(see: http://www.foe.co.uk/campaigns/climate/case_studies/smart_appliances.html).
It would be interesting to see how the power consumption can be optimized with the markedly varying supply (we live in Glasgow / West of Scotland and wouldn’t be allowed a wind turbine in our built up area, so solar is the only option we have for electricity.
Thanks for the interesting report!