Liz: Here’s a guest post from our old friend Pete Stevens, who runs Mythic Beasts, the hosting company that keeps this website on its legs even though more than 100,000 of you visit every day. He’s in charge of a Raspberry Pi which has some of the best connections in the world. And we don’t mean social connections: read down to learn more. (This post was first published at http://blog.mythic-beasts.com/.) Thanks Pete!
Raspberry Pi hosts itself
The first problem was obtaining a Raspberry Pi as buying one was tricky: firstly the online shops were down, then the queue for a Pi was rather long. As any banker can tell you, occasionally crime does pay, so I abducted Mooncake, a cat which owns Liz and Eben. I then ransomed the feline back in exchange for a Raspberry Pi.
[Liz interjects: and Mooncake hasn't got over it yet. She now hides every time someone with a beard visits the house.]
The hardware setup starts with a power supply with an IEC14 connector connected to the masterswitch for remote power cycling. This PSU connects to a powered USB hub, with a USB lead connecting to the power connector on the Raspberry Pi. The Pi is then connected back to the hub on the data cable with a 1TB USB external hard disk attached to that. There’s a 100Mbit ethernet cable which connects up to the core Mythic Beasts network and out to the Internet. Technically the switch port on the other end is 1Gbit but the Raspberry Pi isn’t fast enough to use that.
The yellow fibre in the background is a very large Internet exchange with over a terabit of bandwidth. The Pi isn’t connected directly (that’d be too stupid even for us) and the packets travel from the Pi to the exchange a couple of feet away via another building. However with LONAP and LINX within 2ms and AMSIX a mere 8ms away it’s still rather well connected.
The software setup on the Pi is fairly straightforward. We started with the Debian squeeze image, ssh/apache enabled, munin enabled (graphs here). We’ve changed the password (obviously), the ssh keys (shipping the same ssh key on every OS image isn’t optimal), and moved /var/www and /var/log to the USB disk so as not to fill the SSD card. rpi-update was needed to make the USB/network setup stable under load as the initial image kept crashing. We also set the RAM split to 224MB for Linux as we really aren’t using the GPU.
It’s up and running both IPv4 (184.108.40.206) and IPv6 (2a00:1098:0:80:1000:13:0:3), as the core Raspbian server is also running IPv6 and the main Raspberry Pi server is also IPv6 at present; this machine has seen more than 50% of its traffic over IPv6. I suspect this will change as people download images from it though.
At present the Raspberry Pi is devoting nearly half its CPU to drawing munin graphs so I need to benchmark the new Raspbian distribution to see if the hard float debian build improves the anti-aliasing, as presently all the calculations are done without using the FPU on the arm core in the Pi. Benchmarking suggests that we can deliver 35-50Mbps of file downloads reasonably comfortably at present.
Is this sensible? We’ve had a few customers ask us if the Raspberry Pi would be a sensible device for hosting on as it’s very cheap and very low power. Unfortunately it’s also very slow for this kind of application and the supporting hardware is very bulky. The i7 quad core Mac Mini occupies less space than the Pi + hub + disk + PSU, uses about fives times as much electricity, costs about five times as much once you include the supporting hardware but is hundreds of times faster. So revolutionising the hosting industry isn’t going to happen with the Raspberry Pi, at least not until they build a PoE one with gigabit ethernet and more RAM.
[Liz: you may be waiting some time for that, Pete. I'd stick to the Mac Minis.]
It’s not currently sensible to do this with shelves full of Raspberry Pis because the performance per Watt isn’t good enough. But we’re working on it.
Thanks go to Liam Fraser and Mike Thompson for adding us to the official mirror lists for the Pi and Raspbian. Additional thanks go to Eben and Liz for paying the ransom fee of one Raspberry Pi in exchange for the safe return of Mooncake.