Those of you who know me understand that I have an unhealthy obsession with security and optimization. I acknowledge that this is sometimes a bad thing, and that I spend (waste?) countless hours reexamining my codebases, over and over, trying to find a way to shave off a few wasted CPU cycles here and there. And I almost always find things to improve upon, preventing the satisfaction of feeling like any project is ever completely done.
For all the work and stress, I still enjoy — at least at the end when I have an elegant solution for whatever it is I was working on — doing things this way. I get angry when I see shitty code, especially when the only reason it’s shitty is that someone declared it “good enough” and just shipped it. It’s not that hard to do things right. I’m saddened to think how much faster and more efficient computers — and society in general — could have been, had more people cared about optimization and efficiency over rapid development.
Not too long ago computers had memory measured in kilobytes, and yet meaningful work was done. Now I experience visible keystroke lag running LibreOffice on a $3,000 MacBook Pro. (Thanks, JVM!)
Electron apps are the craziest thing yet. Somewhere someone decided that the easiest way to do cross-platform is to write your desktop applications in a super shitty markup language (does anyone anywhere think HTML is a good page descriptor language?) and then ship them with a bloated, stand-alone web server and web browser. The amount of layers of abstraction, interpretation and emulation are insane, and this is now a totally standard practice!
Recently, I was reading about Amazon Web Services’ new open-source container virtualization project, Firecracker. Now here’s someone doing something right. The absolute minimum required to get the job done — zero fluff. No bullshit.
I probably won’t get a chance to work Firecracker into any of my projects, as I generally don’t work with bare metal hardware — VPS providers are far too cheap these days to bother with metal — but I’m very happy to hear that such a thing exists. I decided to play with it on my local development laptop, just to see how it works.
It turns out that the Firecracker documentation and examples use Alpine Linux. I haven’t been living under a rock, so I’ve at least heard of Alpine, but I never paid it much attention. At the time of this writing, Alpine is ranked #53 on Distro Watch, much too far down the list to be taken seriously by most people.
Learning how to use Firecracker caused me to start playing with Alpine. And I loved what I saw.
For years I have been toying around with the idea of doing some Linux from Scratch style project, and making a custom, super tight Linux environment for running web servers on $15/year 128MB RamNodes. Creating your own Linux Distribution is just as hard as it sounds, and, while I’m sure I could have pulled it off, I never bothered to put in the effort.
Alpine is far better than anything I could have created, and has all the same design goals. I’m super excited, being the type of nerd who gets super excited about server operating systems.
It didn’t take long before I found a script that converts a Debian or CentOS VPS to Alpine, so I now can run it on almost any OpenVZ provider.
The base install — with cron, syslog, and OpenSSH installed — is only 12MB. At startup only 3MB of RAM is in use. Every aspect of this operating system is designed to be as lightweight, resource efficient, and secure as possible.
I’ve fallen in love, and I’m likely to be using Alpine for most of my projects going forward.