[Yum-devel] Fastest mirror selection plugin
mstenner at linux.duke.edu
Fri Aug 12 19:15:06 UTC 2005
On Fri, Aug 12, 2005 at 05:21:54AM -0700, Panu Matilainen wrote:
> >I put together a yum plugin that hooks into the predownload slot and
> >sorts the repo's mirrorlist by connection speed. The initial concept
> >of the mirror selection algorithm was taken from the fastest_cvsup
> >project, which seems to be very fast (after multi-threading it) and
> >pretty reliable.
> Haven't tested it yet but looks very cool!
> Maybe this functionality could find a home in urlgrabber itself - solving
> the fastest mirror is a pretty typical problem I think...
Trivial. I planned for things like this :) Look at the end of
I'm happy to add a class there that includes this functionality.
You might consider adding two
a) one that only adds a method for sorting the mirrors. That way,
one could add and remove mirrors dynamically and resort as
necessary. Call it something generic like .sort() so that
subclasses can do the same thing but sort differently.
b) a subclass that calls .sort() from __init__()
The latter could be used from yum with zero extra work. Anyway, if
you wanna send a patch, I'd be happy to include it (subject to careful
quality/style considerations, but it looks good so far). The fact
that it would be subclassing-only makes me much more cavalier :)
Michael D. Stenner mstenner at ece.arizona.edu
ECE Department, the University of Arizona 520-626-1619
1230 E. Speedway Blvd., Tucson, AZ 85721-0104 ECE 524G
More information about the Yum-devel