[Yum-devel] Fastest mirror selection plugin
pmatilai at laiskiainen.org
Sat Aug 13 22:04:19 UTC 2005
On Sat, 2005-08-13 at 13:56 -0700, Michael Stenner wrote:
> I really like this idea, and it's clear that it's simple to implement.
> However, I'm inclined to implement it with select rather than threads.
> Threads aren't bad in a simple case like this, but select is simpler
> still. I'm generally inclined to go that route for network stuff.
> 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.
> I'm not unconvincable here. I just wanted throw the idea out and
> throw it early so we could talk before you spend a lot of time on it.
I think I might have time tomorrow to whip together a select() based
implementation but if somebody beats me to it.. It's not exactly going
to be a massive amount of code anyway. :)
- Panu -
More information about the Yum-devel