Once a client had been redirected to a certain mirror, it was redirected to In the past, we used "mirror stickiness": Thus, the server doesn't redirect for such files. For certain files it is hard to make sure that they are current on all mirrors, because they change frequently. If no mirror is known for a given file, the server will simply deliver the file itself. #Redirector code#Once a mirror is selected, the redirector returns an HTTP status code 302 (Found) and includes a Location header with the redirection URL, which makes the requester go there. Store combination client ip mirror id in memcache daemon If memcache daemon knows combination of this client ip and this mirror id:Įlse if continent of client is same as mirror:Ĭhosen = find lowest ranked mirror(country pool)Ĭhosen = find lowest ranked mirror(continent pool)Ĭhosen = find lowest ranked mirror(world pool) * use the "score" to give each mirror a weighted randomized rank */ | serverid | identifier | country | region | score | baseurl | WHERE file.path=canonicalized_filename AND server.enabled=1 AND server.status_baseurl=1 AND server.score > 0 SELECT file_rverid, server.identifier, untry, server.region, server.score, server.baseurl \ * New Zealand case - pick a mirror from Australia */ If client country needs to be treated as another country: Look up country and continent of client IP via GeoIP Is the file excluded from being redirected by user agent / client IP / mime type / filemask?Ĭanonicalize filename, resolving symlinks in the path The way how mirrors are selected might be easiest to follow when looking at some pseudocode. More information about the technical implementation as well as background documentation and can be found on the MirrorBrain project page. All in all, these exceptions result in about 50% of requests being redirected to mirrors. In addition, files that are not present on any mirror yet, or are not intended to be mirrored at all, are sent out directly. Tiny files are another exception, because an HTTP redirect would be of the same size as just delivering the tiny file itself, thus saving the client a further round trip. Some are not - for security reasons, certain files (like signatures) are delivered directly off. Most openSUSE downloads (,, ) are handled in this way. #Redirector free#It uses MaxMind's GeoIP, a free database that maps IP addresses to countries and regions in order to figure out the location of the requester and then query the mirror database to get a list of potential mirrors, and choose the best one. The key of this framework is the redirector itself, an Apache module called mod_mirrorbrain. Another essential part of the framework is the monitoring, a daemon which periodically probes the mirrors with HTTP requests, to check their online status - to ensure working redirects at any time. This database is being updated continuously by mirror "scanner", which is able to crawl mirrors via ftp, http and rsync. To achieve this, there is an entire framework, which forms some kind of "mirror brain", which keeps a mirror database as a "state cache" for every file on every mirror. The goal of is to provide an automatic and transparent mirror selection, that fits best for every user, based on his location (GeoIP) and on mirror performance. (Those aren't used anymore, but the current implementation has its roots in their essential technical design.) #Redirector download#And of course lots of other people have contributed with their input, in particular Christoph Thiel, who implemented the first two iterations of the download redirector. People to name are Jürgen Weigert and Martin Polster (scanner, mirrorprobe), Peter Poeml (mod_mirrorbrain, mirrorprobe), Marcus Rueckert (the Ruby prototype). The current implementation is a combined effort by several people. Later, the project became an independent project, and can now be found on. There was also a prototype implementation in Ruby which can be integrated via FastCGI, however the Apache module is what we use. They were superseded by the (current) implementation in C as Apache module. The first two iterations of the redirector were written in PHP. This first proof of concept didn't include any of the feature that are present in today's redirector, accessible at. To ease the download of openSUSE, the first version of the download redirector was developed in late 2005 and presented at FOSDEM 2006.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |