[Yum-devel] Fastest mirror selection plugin

Luke Macken lmacken at redhat.com
Thu Nov 17 09:59:46 UTC 2005


On Wed, Nov 16, 2005 at 11:28:28PM -0800, Panu Matilainen wrote:
| On Wed, 16 Nov 2005, Luke Macken wrote:
| >Excellent -- I have been meaning to look into calculating the fastest
| >mirror earlier on in the process for a while now... no free time.
| >
| >One minor issue with the code though; duplicate hosts still get added.
| 
| That's actually on purpose, duplicate hosts need to get added when they 
| appear on different mirrorlists.

Ah-ha.  At first I though the plugin was bitching about duplicate mirrors,
not thinking of course that each mirror could have different repo paths
to keep track of.  Nevermind then ;)

| >As long as we're not modifying the timedhosts outside of the critical
| >section (which we're not), then it's probably not a *huge* deal --
| >worse case scenerio is that it looks for a duplicate host in the list
| >while it is being added and doesn't find it?.  I'll leave it as-is for
| >now, and look in to that a bit later.
| 
| I thought so as well, and at least in my tests the unprotected read 
| accessses didn't seem to cause any anomalies, although that could be just 
| pure luck :)

Ah, the dark magic of python.  The only potential anomalie I can think of
is some sort of concurrency exception, like javas -- if python even has
such a thing.

| Next thing I have in mind wrt this is to add persistance - calculate the 
| mirrors once and store them someplace and only recalculate every now and 
| then, a simple approach would be "if the mirrorlist is older than a day or 
| week" or something. Another thing I thought about is recalculate when 
| network mask changes: desktops and servers typically don't much move 
| around but a laptop can move around a lot and affect the optimal mirror 
| selection.

Not a bad idea.  I might try and hack something together this week that
talks with NetworkManager and stores the current location and mirrorlist
locally.


luke



More information about the Yum-devel mailing list