Rearchitecting GitHub Pages
Pretty similar to how Neocities serves static sites (<a href="https://neocities.org" rel="nofollow">https://neocities.org</a>).<p>There's a few differences. We don't use SQL in the routing chain, we use regex to pick out the site name and then serve from a directory of the same name (this is NOT as bad as it sounds, most filesystems can do this quite well now and take MUCH more than half a million sites to bottleneck).<p>DRBD is also a little hardcore for my tastes. Nothing wrong with it, I just don't know it well, and I don't like being dependant on things I don't know how to debug.<p>An alternative I wanted to show uses inotify, rsync and ssh combined into a simple replication daemon. It's obviously not as fast, but if you enable persistent SSH connections, it's not too bad. If it screws up, you can just run rsync. 
Rumor has it the Internet Archive uses an approach not too far away from this for Petabox. Check it out if you're looking for something a little more lightweight for real-time replication:
<a href="https://code.google.com/p/lsyncd/" rel="nofollow">https://code.google.com/p/lsyncd/</a><p>We're still working on open sourcing (!) our serving infrastructure, so eventually you will be able to see all of the code we use for this (sans the secrets and keys, of course). I've just been having trouble coming up with a good solution for doing this. For now, enjoy the source of our web app: <a href="https://github.com/neocities/neocities" rel="nofollow">https://github.com/neocities/neocities</a>