[Yum-devel] Fastest mirror selection plugin

Michael Stenner mstenner at linux.duke.edu
Sat Aug 13 22:25:07 UTC 2005

On Sun, Aug 14, 2005 at 01:04:19AM +0300, Panu Matilainen wrote:
> On Sat, 2005-08-13 at 13:56 -0700, Michael Stenner wrote:
> > Using select also has one other advantage: you currently wait the
> > timeout for all threads to return and then pick the fastest (well,
> > sort, really).  You could also simply stop waiting after you get the
> > first N responses.  So, for example, if your first mirror responds
> > after 0.2 seconds, you can just stop waiting for the rest.  Sure, you
> > can do that in threads, too, but it's harder.
> Figuring just the fastest mirror doesn't help yum (might of course be
> useful for other cases): if the fastest mirror happens to be out of
> sync/otherwise in bad state, you'll want to have more than one mirror to
> work with. Maybe wait for some percentage of available mirrors to
> respond and then use that sorted list for failovers. 

Agreed.  I suggest the following:

  make two configuration variables:  
     timeout     --  how long to wait
     stop_after  --  the number of mirrors we want (2 or 3 by default)
     (feel free to think of better names)

  If there are N mirrors, then it should stop when ANY of the
  following happen:

    stop_after mirrors respond
    N-1 mirrors respond (no need to wait for the last one)
    timeout is exceeded

I do not propose that we make these yum options, at least not now.
Lets just pick nice defaults (like stop_after = 2 and timeout = 3
seconds) and let it be.

  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 mailing list