Hi, Thanks to the help of Adam Borowski we now got a working solution for an automatic mirror selection scheme.
Please help us test this infrastructure so that I can convince the DSA to add it to our servers or at least give us a delegation from a debian.{net,org} subzone! ;) Again: I have no intention of supplanting any current structure, only adding some more functionality to what we already have. How to make it work: -------------------- Simply change whatever mirror you're currently using on /etc/apt/sources.list to: <arch>-geomirror.debian.net Where <arch> is the output of "dpkg --print-architecture". Please make sure the DNS propagation has hit you, since the debian.net aliases were all created earlier today. How it works: ------------- The <arch>-geomirror.d.n addresses are manually added CNAMEs to a PowerDNS server that manages the zone geomirror.angband.pl (helpfully loaned by Adam Borowski). This server is running pdns-backend-pipe, which simply runs a script to determine the best mirror based on the contents of Mirrors.masterlist[0], the IP that originated the request and the requested architecture. The current logic for selecting mirrors is very crude and only makes sure the selected mirror is on the user's country and has the selected arch, prioritizing mirrors that are called 'ftp.*.debian.org' and leafs over push mirrors. One possible improvement would be fetching information from DMC[1] to help the prioritizing of hosts based on freshness (this could also help avoid temporarily downed mirrors). The source code for the backend script is available at[2]. The name 'geomirror' was picked for lack of a better suggestion. Please feel free to give one! ;) Known problems: -------------- Since it's based on CNAMEs, a mirror that works on a separate virtual host than the server's default won't be usable by this scheme. In a quick test scan (ignoring all non-related errors), about 84 of the 358 archive mirrors are affected by this issue, 9 of which are top-level country mirrors (BR, CL, HK, IS, IT, PT, TR, UK and 2 of the 4 round-robins for CA). Simply adding: "ServerAlias *.geomirror.debian.org" (or whatever the official address ends up being) to apache-based mirrors should suffice, so I hope getting a delegation from DSA would be enough to ask the mirror admins to add this alias to their mirrors. Please correct me if I'm wrong and there's some other big problem I'm not seeing. Another minor problem is that the use of some DNS resolver that's not on the same country as the user (OpenDNS, for instance) will result in a incorrect guess by the server. Cheers [0] http://cvs.debian.org/*checkout*/webwml/english/mirror/Mirrors.masterlist [1] http://www.de.debian.org/dmc/today/ [2] git://git.debian.org/~costela/mirror_picker.git -- Leo "costela" Antunes [insert a witty retort here]
signature.asc
Description: OpenPGP digital signature