[Yum-devel] Fastest mirror selection plugin

Panu Matilainen pmatilai at laiskiainen.org
Sat Aug 13 11:24:25 UTC 2005


On Fri, 2005-08-12 at 12:15 -0700, Michael Stenner wrote:
> On Fri, Aug 12, 2005 at 05:21:54AM -0700, Panu Matilainen wrote:
> > 
> > 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
> mirror.py:
> 
>   http://tinyurl.com/82qa4
> 
> 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 :)

Well... here's a quick-n-dirty patch to urlgrabber + patch to make yum
use it if folks want to test drive. Seems to work basically - you can
really tell the difference between random mirror vs fastest in just
depsolving / header downloading phase. Some issues to sort out:
- we end up sorting the mirrorlist twice which adds much unnecessary
overhead to it
- the socket timeout should be made configurable
- urlgrabber now imports both thread and threading modules which is
silly 
- I hate the "MGSortable" class name :)

	- Panu -
-------------- next part --------------
A non-text attachment was scrubbed...
Name: yum-failover-fastest.patch
Type: text/x-patch
Size: 613 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20050813/e83f0595/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: urlgrabber-fastest-mirror.patch
Type: text/x-patch
Size: 2485 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20050813/e83f0595/attachment-0001.bin 


More information about the Yum-devel mailing list