[Yum-devel] Fastest mirror selection plugin
Panu Matilainen
pmatilai at laiskiainen.org
Thu Nov 17 07:28:28 UTC 2005
On Wed, 16 Nov 2005, Luke Macken wrote:
> On Wed, Nov 16, 2005 at 11:11:47PM +0200, Panu Matilainen wrote:
> | Here's another variant of the plugin - this one figures out the fastest
> | mirrors before metadata download which makes quite a difference
> | especially on large updates:
> | http://laiskiainen.org/yum/plugins/fastestmirror/fastestmirror-meta.py
>
> 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.
> 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 :)
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.
- Panu -
More information about the Yum-devel
mailing list