Tuesday, August 16, 2011

1 Watt webserver

I recently bought a Zipit 2 from an online store. It is a tiny device with an ARM CPU (XScale-PXA270) with 32MB of RAM, an SD card slot, and 802.11 networking. The device cost me $30 including shipping, which is a cheap price for the computing potential. My goal was to run Linux on it, and learn the ARM instruction set. There are many Linux distributions for the Z2, and I found Debian on the Z2 to be perfect. The device is small, light and fits in the pocket of my jeans. Its battery lasts four hours when the screen is on.

Installing Linux on it was trivial: you flash a custom bootloader using FlashStock. This loads a new kernel on the small flash partition on the device, and it gives you the ability to boot from an SD card. Then, you download a Linux distribution for the z2 (I chose z2sid), copy the image to the SD card (using a raw copy tool like dd) and boot from it. I have an 8GB SD card in the Zipit. This Z2 is better than my first Pentium computer along every single dimension except screen size.


Once Debian is installed on the Zipit, you have access to the 'apt-get' package management tool. After installing vim, gcc, make, it turned into a fully functioning ARM development system. I did not want to type using the tiny keyboard, which is uncomfortable and lacks important keys. So I installed an ssh server called dropbear. Now I can remotely log in to the device, copy files back and forth, and use it for development.

Once it was set up, I wondered if I can serve web pages from it. After installing a webserver called nginx, the zipit holds up very well. I'm serving three virtual hosts externally from it, and two hosts internally. For a small amount of traffic, this is the perfect device.

Power consumption

With the screen turned on, the Zipit consumes less than 2 watts of power. When the lid is shut, the screen turns off and power consumption drops to 1 watt. By comparison, a typical laptop consumes 30 Watts and a typical desktop consumes 100 watts. The device is dead silent and cold to the touch. Due to the low power consumption, it generates no perceptible heat. You can leave it in the corner of a cramped closet, and it will chug away. Silently.

There is a lot of potential in these low-power devices called plug computers. Plug computers and mobile devices have caused a resurgence of ARM processors due to their low power consumption. With improvements in processor technology, an entry-level ARM CPU can handle tasks reserved for a "real" computer. Web serving, file serving and ssh-login don't require a beefy processor.  Rather than maintain a full computer, you can purchase a small, silent, and low-footprint computer to handle these tasks for you. Once it is set up, you can store it in a closet somewhere, completely out of sight. Low power consumption allows the device to run exclusively on solar power.

You could use it as an entry point to a home network. Once the SD card is copied to a desktop, you can recover from a malicious attack by copying a known-good image back onto the card.

Low-power computing holds a lot of promise. In the developed world, it can be used instead of power-hungry computers for routine tasks. In the developing world, it can be the first computer for a family.