When I launched my Flickr Widget a couple of years ago, I decided I would host the tiny little Flash file that is the heart of the widget. I didn’t want to bother end users with downloads and installs and such. I put the file on Amazon’s S3 service, and offered an embed code generator form on this site. This worked well for a while, but more and more people started using the widget. Soon, Amazon started sending me hefty monthly bills.
I experimented for a while with hosting the file on the same server that runs this blog, but my host did not like that idea. Their terms of service don’t allow me to host non website-related files. So I moved the file to a friends VPS (Virtual Private Server). By then, the 5 KB Flash file was being served millions of times a month, causing around 30 GB of monthly traffic. I needed a more permanent solution.
A low end box
That’s when I stumbled across Secure Dragon. I found them through Low End Box, a community dedicated to running small, efficient VPS servers. They seemed to have a pretty good track record, their VPS servers came with plenty of monthly data and they were very affordable. I decided to try setting up a small, dedicated VPS with them just to host my Flash file.
Four megabytes of RAM
Signing up was super easy, and the VPS was activated instantly. I was a little surprised that I didn’t get to choose the OS image to be used for my VPS but it turned out to default to the one I wanted anyway. Secure Dragon offers a stripped down version of Debian Linux that uses only 4 MB of RAM when idle. To me, that’s astoundingly little memory. It leaves quite a bit of headroom, even on my 128 MB VPS. It comes with the bare essentials (SHH, cron, etc) but little else.
For a client project, I’ve been trying to get Apache web server to cope with a large number of requests. I don’t want to go into details, but let’s just say Apache was not the right choice for my new low end box. I decided on lighttpd (“Lighty”) instead, because it’s really easy to set up, and is known for handling tons of requests with ease.
I set up Lighty with almost no extra modules. I didn’t need PHP or URL rewrites. A full LAMP stack (or rather LLMP) would have consumed more resources and introduced additional complexity. All I needed was LL (Linux, Lighttpd). Lighttpd had some problems with memory leaks in the past, but I have yet to notice anything out of the ordinary.
Load average: 0.00, 0.00, 0.00
The result is a tiny little VPS that is still significantly overpowered for what it’s doing. It’s humming along nicely, at near-idle load levels, while serving hundreds of thousands of requests daily. On average, the whole setup uses around 12 MB of RAM. This doubles when I sign in over SSH, so I have to rely on the graphs that SD offers in their control panel.
While I’m not a Linux system administrator, I feel confident that I did a decent job setting this up. The minimal Debian image was a great start, and there are tons of very good tutorials out there that help you install lighttpd and secure your VPS. I’m looking forward to maintaining this setup and keeping those Flickr images floating.