The Raspberry Pi seems nice hardware for a small home server like the FreedomBox. It is both low power and low cost. The only questions for me were: is it powerful enough - how does it compare to other computers?
On the Raspberry Pi website I read that it's performance is roughly equal to a 300 MHz Pentium 2 which is not very helpful. I once owned a 300 MHz Pentium 2 system, but that was 15 years ago. I really have no idea how any modern system compares to it.
In my previous article I measured the performance of the MK802 stick computer. This computer turned out to perform roughly equal to a single core Intel Atom. Last week I finally got my own Raspberry Pi so I decided to run the same tests for the Pi.
I bought version 2.0 of the Raspberry Pi model B. This version has the following hardware:
SoC: Broadcom BMC2835
CPU: 700 MHz ARM 11
GPU: Broadcom VideoCore IV
Memory: 512 Mb (shared with GPU)
USB: 2 * USB 2
Video: Composite out, HDMI 1.4
Audio out: 3.5 mm jack + HDMI
Network: 10/100 Mbit RJ45
Storage: 32 GB Samsung class 10 SD card
As OS I use Raspbian. This is a Debian derivative that has been optimized for the Raspberry Pi.
To measure the performance I used an experimental python-powered version of my blog. This version does not use a database, but stores the individual postings in a simple directory structure. For each request 10 postings are read from disk and served as one HTML page that looks (almost) exactly like my normal blog. The size of this page is 64.9 Kb.
On a fast system Apache bench was used to measure the performance in pages/sec. I requested 1000 pages with a concurrency of 10.
The measurements were done for the following systems:
The Raspberry Pi model B version 2.0, running at 700MHz
My current FreedomBox. This is an 1.2 GHz Marvell Kirkwood 6281 system. The same SoC is used for the DreamPlug.
The MK802, which uses an 1 GHz Allwinner A10.
An Intel Atom 330 system running at 1.6 GHz.
My Desktop system with a dual core G620 Pentium processor running at 2.6 GHz.
Except for the MK802, all systems have a wired 1Gb Ethernet connection. For the MK802 i did two measurements: one with WiFi Ethernet and one with a wired 100Mb USB-Ethernet adaptor.
Raspberry Pi Marvell MK802 MK802 Atom Desktop
ARM 11 6281 WiFi Wired 330(*) G620 (**)
Pages/sec. 17 25 12 39 174 805
MB/sec. 1.1 1.64 0.77 2.5 11.2 52
Power (W) 3 (#) ~13 3-4 (#) 4 (#) 35 45
Pages/sec/W 5 2 3 10 5 18
(#) A fair comparisson would include 5W for the missing HD
(~) estimation, could not measure without ruining my uptime :-)
(*) 4 threads were used.
(**) 2 cores (= 2 threads) were used.
As you can see, the Raspberry Pi is not very fast. Still I found its performance much better than expected. It roughly performs at 70% of my current FreedomBox and roughly at 40% of a single core Intel Atom clocked at 1.6 GHz. This may not look great but remember that the important question is not how fast it is, but: is it fast enough?
Having expected much worse results for the Raspberry Pi I wondered if the test reflected real-world performance. What if I run some real-world server software like Apache on it? To test this I installed Apache with Wordpress on the Raspberry Pi and copied my blog to the Raspberry Pi.
Requesting the main page of my blog took 3.4 seconds on the Raspberry and 2.6 seconds on my Marvell system. A difference of 25 percent. Not bad! I find the performance of my FreedomBox quite acceptable and I do not think anyone would notice it it was 30 percent slower. So in my opinion the Raspberry Pi would be fine hardware for a FreedomBox.
Recently a whole range of cheap Android devices have become available, all powered by the Allwinner A10 SoC. Thanks to the way A10 devices boot they are very easy to hack. All that is needed is a bootable SD card. How to make such a card is no big secret, and there are now multiple SD card images available. You can boot for example Lubuntu or Debian instead of Android. One A10 device, the MK802 stick computer, is almost ideal for a small home server. I bought one to examine its potential for the FreedomBox.
What makes A10 devices special?
Before i share my experiences with the MK802 i have to write something about its hart, the Allwinner A10 SOC. This remarkable 400 pin (!) chip only costs about $7 and houses the following:
A one core Cortex A8 ARM processor, typically running at 1GHz.
A MALI400MP OpenGL 2.0 GPU.
DDR3 800 MHz controller.
Hardware accelerated video playback.
Video outputs for: HDMI, VGA, Analog video, and LCD.
A 10/100 MHz Ethernet controller.
A NAND Flash controller.
USB Host controller + USB OTG controller.
A SATA-II controller.
Etc, Etc, Etc....
Apart from all the hardware features its boot process is also interesting. Booting goes as follows:
Check if the reset pin is pressed. If so, load new firmware from the USB port.
Check if there is a SD card present. If it contains a bootable image, boot from the SD card.
Boot from the internal NAND storage (boot Android).
Step 1 can recover a "bricked" device. Step 2 makes loading an alternative OS possible. Very hacking friendly!
What A10 devices are available?
The A10 is used in a whole range of products, from tablets to TV multi media boxes to stick computers. The most popular devices are:
The $70 Mele A1000. This is a complete computer. Some specs: 512 Mb RAM, SD slot, support for SATA Hard-disks, connectors for multiple types of monitor (VGA/HDMI/Analog video), 10/100 Ethernet connector, WIFI, Audio out and two USB host ports.
The $65 MK802. This is a stick sized computer (0.47 x 3.46 x 1.38 inch) that has (of course) less connectors than the Mele A1000. The specs are: 1024 MB RAM (older versions 512 MB), microSD slot, HDMI video out, WIFI, one USB host port and one USB-OTG port.
You will probably agree with me that the $70 Mele is a better deal - the MK802 is overpriced. It would not surprise me if the MK802 drops in price to about $40 in the near future.
Booting an alternative OS.
A10 devices have become very popular the last few months and a lot of development is going on. Most development targets Lubuntu (Ubuntu + LXDE) and the Mele A1000.
The best way of running an alternative OS is download a ready made SD image for your device and write this to a cheap SD card (8GB class 4 is fine). On my MK802 i successfully tried the following images:
A Lubuntu 12.04 desktop version, downloaded from miniand.com. This version has a fixed 720p HDMI output with no hardware acceleration. While i'm not very interested in desktop use, i found the desktop performance quite acceptable. This Lubuntu version seems stable too.
The Linaro-alip armhf version. This image is made by Toby Corkindale and has an 1080p HDMI output, again with no hardware acceleration. Desktop performance is acceptable, stability is OK.
How does the MK802 perform?
A small internet-connected server like the FreedomBox should meet the following performance requirements:
It should be fast enough for simple tasks like serving web-pages.
Ethernet/WIFI must be fast enough.
Because the device runs 24/7 energy consumption must be low.
All of these can be measured easily. Measurements are more interesting if you can compare them for different systems, so i decided to do the same measurements for the following systems:
My current FreedomBox. This is an 1.2 GHz Marvell Kirkwood 6281 system. The same SOC is used on the DreamPlug.
The MK802, which uses an 1 GHz Allwinner A10.
An Intel Atom 330 system running at 1.6 GHz
My Desktop system with a dual core G620 Pentium processor.
Except for the MK802, all systems have a wired 1Gb Ethernet connection. For the MK802 i did two measurements: one with WiFi Ethernet and one with a wired 100Mb USB-Ethernet dongle.
To measure the performance i used an experimental python-powered version of my blog. This version does not use a database, but stores the individual postings in a simple directory structure. For each request 10 postings are read from disk and served as one HTML page that looks (almost) exactly like my normal blog. The size of this page is 64.9 Kb.
Apache bench was used to measure the performance in pages/sec. I requested 1000 pages with a concurrency of 10. The results are:
Marvel MK802 MK802 Atom Desktop
6281 WiFi Wired 330(*) G620 (**)
Pages/sec. 25 12 39 174 805
MB/sec. 1.64 0.77 2.5 11.2 52
Power (W) ~13 3-4 4 35 45
Pages/sec/W 2 3 10 5 18
(~) estimation, could not measure without ruining my uptime :-)
(*) 4 threads were used.
(**) 2 cores (= 2 threads) were used.
From the results the following conclusions can be drawn:
The WiFi of the MK802 performs poorly. However, a bandwidth of 770 KB/sec is still well above the upstream speed of most households so it may be considered acceptable.
The 1 GHz A10 processor is much more powerful than the 1.2 GHz Kirkwood processor of my FreedomBox. Personally, i find the performance of my FreedomBox (which runs several virtual machines with Wordpress blogs) quite acceptable. A10 devices will do well as FreedomBoxes.
The A10 performs roughly equal to a 1.6 GHz single core Intel Atom (with no hyper-threading).
Using an Intel Atom or even a desktop computer seems overkill. An A10 powered device should be powerful enough.
Pages/sec/W is a measurement of the energy efficiency. To be honest, these values are not fair because the MK802 is the only device without a hard-disk. A hard-disk consumes about 5 W so it has a big impact. The energy efficiency of the MK802 is excellent.
My overall conclusion is that the MK802 should do well as a FreedomBox. It's a pity that it has no wired Ethernet connection. It has however an USB-OTG port which could be programmed to behave like an Ethernet dongle (just like those WIFI sticks - you plug one in and it is detected as a new network interface)
Here are some links to start with if you are interested in A10 devices:
Much pioneering work on the A10 was done by Luke Kenneth Casson Leighton. Luke is the one behind Rhombus Tech. A Community Interest Company, which is developing an open hardware Computer-on-Module that uses the A10. Lots of info can be found at:
In this article i answer the following question: When does the energy cost of running the FreedomBox software on a desktop computer justify buying specialized low power hardware? The answer to this question may surprise you.
Not long ago a reader of my blog asked me why he could not use his desktop computer to run the FreedomBox software. I answered that he could, but it would not be very economical. I gave him the following example: My desktop computer at the time consumed 93 Watt when idle. Keeping this machine running for a year would cost me 186 EUR. The energy costs of my 11 Watt NAS "FreedomBox edition" is just 22 EUR a year. In this example it is clear that it pays to buy special hardware for the FreedomBox. For my new energy efficient desktop computer (23 Watt idle) the situation is different.
In a previous article Free hardware for the FreedomBox software i argued that the cheapest hardware for the FreedomBox is hardware that you need anyway. If you can run the FreedomBox software on this hardware without changing it's function, then the hardware for the FreedomBox costs you nothing. This is true for always-on devices like wireless routers and NAS servers. With these devices the only cost of running the FreedomBox software is the cost of the extra energy which is probably very low. For desktop computers the situation is different. Desktop computers consume more energy than specialized always-on devices and are only used part of a day (normally).
How much does it cost to use a desktop computer to run the FreedomBox software?
Calculating the costs is very easy. Because you need the desktop computer anyway, the price does not enter the equation. Only the extra energy costs are important. This leads to the following equation:
Cd = Pdi * Td * Ckwh/1000
Cd : Cost of running FB software on a desktop computer
Pdi : Power consumption in Watt of the desktop computer when idle
Td : Time in hours the desktop computer is running FB software exclusively
Ckwh : Kilowatt-hour price.
Because the FreedomBox software is mostly sleeping, i only take the idle power consumption into account.
How much does running a dedicated FreedomBox device cost?
With a dedicated device you have to enter the price of the device into the equation:
Cf = Cfd + Pfi * Tf * Ckwh/1000
Cf : Cost of running FB software on a dedicated FB device
Cfd : Price of the FB device
Pfi : Power consumption in Watt of the dedicated FB device when idle
Tf : Time in hours the FB device is running
Some quick calculations.
Let's compare the cost of my (very) energy efficient desktop computer with a DreamPlug. I use the following parameters:
Pdi = 23 W
Td - do not correct the time for non FB use of the desktop computer.
Cfd = 163 EUR DreamPlug + 50 EUR USB hard-disk = 213 EUR
- assume a 3 year life of the DreamPlug
Pfi = 5 W DreamPlug + 5 W USB hard-disk
Ckwh = 0.25 EUR
In this example using a DreamPlug as a dedicated FreedomBox device is not economical. Even with no correction for the time the desktop computer is used for it's normal tasks, the DreamPlug solution is almost 2 times as expensive.
Using the DreamPlug results for a 3 year period you can calculate the idle power consumption of a desktop computer that is just as expensive as a dedicated DreamPlug. This turns out to be 42 Watt.
Let's calculate the costs of running a Raspberry Pi model B for three years.
Cfd = 39 EUR (32.70 GBP * 1.2 EUR/GBP) + 50 EUR USB HD = 89 EUR
Pfi = 1 W Raspberry Pi + 5 W USB HD = 6 W
Cf = 89 + 6W * 3*365*24 * 0.25/1000 = 128 EUR
The very low power Raspberry Pi is the winner. It would save me 33 EUR over a period of three years. For me, this is not a good reason to buy a Raspberry Pi. (Still think i buy one, just for fun!)
(Note: in these calculations i have not corrected for the time i use my desktop computer for it's normal tasks. If i correct for the 8 hours a day i use my system for desktop-tasks, the desktop costs for running the FreedomBox software would be 100 EUR.)
If you have desktop computer with low idle power consumption, then there is no (economical) need to buy special low-power hardware for running the FreedomBox software.
Maximum measured power is 53 Watt. This is without stressing the graphics core which will probably add an extra 7 Watt if its used to its full capacity.
When I selected the system components I had the following main requirements:
It must be able to use the system to develop software for GNU/Linux.
I wanted to use the system as an internet connected server that runs 24/7.
To isolate my development work from the server-tasks, I want the server-tasks to run inside a virtual machine. The server-tasks are simple (personal web-server, email server, etc.) and do not need a very fast CPU (I am currently using ARM hardware for these tasks)
Because the machine is always on, its important that the system uses as little energy as possible. A one Watt device that runs for a year costs about 2 EUR in the Netherlands. Normal PC's like my old system easily consume 90 Watt or more when idle, which make them very expensive servers.
Both main usages of the system only occasionally stress the system so low energy consumption for the idle state is a main concern.
Here are some remarks on the components I selected.
I selected an Intel G620 processor because its performance is more than enough for my simple tasks. I t has an nice integrated graphics core and low power consumption. With a price of only 54 EUR it's cheap too.
The specs mention a TDP of 65 Watt. My whole system never uses more than 60 Watt so this is a bit pessimistic. I think a TDP of 35 Watt like the special energy efficient G620T version is more realistic. When compared with the G620T the G620 only uses one or two Watt more.
Finding the right mainboard was a bit tricky. Power consumption varies quit a bit between different products. Even when idle the difference in power consumption can be over 10 Watt! A very nice comparison of 21 mainboards can be found here. From this comparison you can see that the Intel DZ68DB mainboard I selected does very well.
Here I had two requirements. High efficiency and low noise. These qualities are both present in the selected Be quiet! Straight Power E9 400W. This power supply has an 80Plus gold certification, which guaranties an efficiency of 90% or more. For cooling an 135mm SilentWings fan is used resulting in an extremely low noise level of under 15 dB(A) at full load. With a price of about 70 EUR this power supply is twice the price of a standard power supply. When I look at the specs and build quality I find this very good value for money.
Not much to say. I bought 8GB just to be able to compile very large programs and run the VM's
I bought an energy efficient Western Digital Caviar Green WD5000AZDX, 500GB. This HD is fast and almost silent.
The integrated graphics core of the G620 processor is more than capable for any graphics task other than gaming. Video decoding is pretty good. I even managed to play the “killa sampla” with only a small distortion in the first two seconds of the clip.
At the moment i'm running the testing version (Wheezy) of Debian GNU/Linux on the system. Quite a nice experience, everything worked out of the box and no proprietary drivers needed to be installed.
I only needed to make some small adjustments to the kernel settings in order to lower the power consumption. It turns out that the 3.x kernels have support for the power saving features of the integrated graphics core of the G620 processor, but these features are disabled by default. To turn the features on you have to edit the grub boot configuration as follows:
Most of the readers of this blog will probably know the Tor project. One of the problems that Tor has encountered is that all nodes of the Tor network are public. This enabled governments to block all IP addresses of the Tor nodes, preventing anyone behind their firewall to use Tor. To solve this problem the Tor project created a pool of unlisted Tor nodes known as bridges. If a user gets blocked, he/she can ask for the IP address of (only) one of these unlisted Tor nodes and use this node as the entry point to the rest of the Tor network.
The function of a Tor bridge is simple: provide an unlisted IP address that blocked users can use to connect to the rest of the Tor network. You can run a full Tor node at the unlisted address, but you don't have to. Forwarding the traffic from the unlisted address to a public Tor node will provide the same functionality and can be done by a simple router.
How to configure a router to forward Tor traffic?
Forwarding traffic from the internet to your local network is very easy. Every router has a nice UI that can be used to do this. Forwarding traffic from the internet to another IP address in the internet zone is slightly more complicated. This type of forwarding is so uncommon that most (all?) routers simply leave it out of the UI.
The first step you have to take if you want your router to forward Tor traffic is to replace the firmware with less limited free software. I replaced the firmware of my TP-Link router with OpenWrt. With OpenWrt you have access to all the functions of your router.
With full control of your router forwarding Tor traffic is simple. I started a ssh connection to my router and typed the following three commands:
eth0.2 WAN-interface of the internal router switch
xxx.xxx.xxx.xxx WAN IP address
188.8.131.52 IP address of the rainbowwarrior Tor node
The first command tells the iptables firewall to translate the WAN IP address to the address of the rainbowwarrior Tor node if the destination port is 443. The second command changes the source address of packets leaving the system into the WAN address. The last command allows traffic with the rainbowwarrior Tor node destination to pass through the system.
That's it. I checked this using a remote system and it seems to work. Double checking with Wireshark showed all traffic was routed through my router-bridge.