[mirror-admin] fastestmirror (was Re: Redirecting Rawhide to Private Mirrors)
Gilbert E. Detillieux
gedetil at cs.umanitoba.ca
Fri Apr 24 15:54:56 EDT 2009
On 2009-04-24 11:46, Andrew McNabb wrote:
> On Thu, Apr 23, 2009 at 01:38:52PM -0500, Gilbert E. Detillieux wrote:
>> 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
>>
>> Any Python wizards out there who'd be willing to give it a shot?
>
> I've whipped together a patch that does a slightly better job of
> measuring mirrors. Instead of just timing how long it takes to connect,
> it times how long it takes to download repomd.xml from the mirror. This
> still isn't perfect, since repomd.xml isn't particularly large, but the
> results should be much more sane than what we're currently seeing. The
> patch is posted to bug 484371:
>
> https://bugzilla.redhat.com/show_bug.cgi?id=484371
>
> It would probably be helpful if someone tests it out and posts a comment
> to the bug report.
Andrew,
I've posted the following comment to the bug report:
--- Comment #6 from Gilbert E. Detillieux <gedetil at cs.umanitoba.ca>
2009-04-24 15:47:11 EDT ---
I've tried the patch on a Fedora 10 system, and then on several CentOS
5.3 systems (both i386 and x86_64), and it seems to work like a charm!
Finding the fastest mirrors is a bit slower than before, but still
acceptably fast. And the results are much better: closer (or at least
more well connected) mirrors seem to consistently come up at the top of
the list now.
My test method:
1) yum clean all
2) yum check-update
3) sort -k2n /var/cache/yum/timedhosts.txt
4) (repeat until satisfied)
Before the patch was applied, results (in the timedhosts.txt file)
varied from run to run, with distant, slower sites often winning out
against local mirrors. With the patch, I get much more consistent
results. When the sort order is different, it's usually just a few
sites with fairly similar timing getting flipped around.
Well done!
--
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