[mirror-admin] fastestmirror (was Re: Redirecting Rawhide to Private Mirrors)

Gilbert E. Detillieux gedetil at cs.umanitoba.ca
Thu Apr 23 14:38:52 EDT 2009


On 2009-04-23 12:22, Andrew McNabb wrote:
> ...  I then looked at /var/cache/yum/timedhosts.txt and found that
> mirrors.cs.byu.edu is considered slower than several other hosts.  This
> is very strange because the private mirror is orders of magnitude faster
> whether measured by latency or bandwidth (the reason I noticed there was
> a problem is that downloads were so slow).  What does fastestmirror use
> to determine how fast a host is?

It really comes down to these 3 lines of Python code (in 
/usr/lib/yum-plugins/fastestmirror.py)...

                     time_before = time.time()
                     sock.connect((self.host, self.port))
                     result = time.time() - time_before

So, it's basically timing a single socket connect (which will cause the 
usual TCP SYN/SYN-ACK/ACK handshaking to happen).  That's a pretty weak 
test of mirror speed, IMHO.

I've noticed similar weirdness here too, where we have a local mirror on 
our 1 GB/s LAN, but fastestmirror often points our local client hosts to 
servers on other continents instead!  I've been thinking I'd like to fix 
this code to do a more thorough test, perhaps something like an httping 
test, but I haven't had time to go beyond just thinking about it and 
griping occasionally.  ;)

Any Python wizards out there who'd be willing to give it a shot?

-- 
Gilbert E. Detillieux		E-mail:	<gedetil at cs.umanitoba.ca>
Dept. of Computer Science	Web:	http://www.cs.umanitoba.ca/~gedetil/
University of Manitoba		Phone:	(204)474-8161
Winnipeg MB CANADA  R3T 2N2	Fax:	(204)474-7609

--


More information about the Mirror-admin mailing list