MirrorBrain is a framework to run a content delivery network using mirror servers. It solves a challenge that many popular open source projects face: a flood of download requests, often magnitudes more than a single site could practically handle. A central (and probably the most obvious) part is a "download redirector" that automatically redirects requests from Web browsers or download programs to a mirror server near them. Choosing a suitable mirror for a user's request is the key, and MirrorBrain uses geolocation and global routing data to make a sensible choice and achieve load-balancing for the mirrors at the same time. The algorithm is both sophisticated and easy to control and tune. In addition, MirrorBrain monitors mirrors, scans them for files, generates mirror lists, and more.
mod_asn is an Apache module that uses BGP routing data to look up the autonomous system (AS) and the network prefix (subnet) which contains a given (client's) IP address. mod_asn is highly scalable. To do lookups in high-speed, it uses the PostgreSQL ip4r datatype, which is indexable with a Patricia Trie algorithm to store network prefixes. This is the most suitable algorithm, being able to search through around 250,000 existing prefixes quickly. mod_asn is usable as a standalone module, and the lookup result can be used by scripts or other Apache modules. For instance, a download redirector could base its decisions on the lookup result provided by mod_asn.