old blog,

Hack: A bit better yum-fastestmirror patch

Izhar Firdaus Izhar Firdaus Follow Support Dec 25, 2008 · 1 min read
Hack: A bit better yum-fastestmirror patch
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.
Those who use Fedora might be familiar with yum-fastestmirror plugin. Its a plugin for yum which polls yum mirrors for the one which responds the fastest. However, sometimes, the polling result might not be one might expected.

For example, with the current fastestmirror, I usually get the singaporean mirror as the fastest. But, the singaporean mirror, in fact, only gives me around 2-4KBps download speed, which of course, pissed me off. The taiwanese and the australian mirrors give faster speed than that. So, I went looking at the fastestmirror code.

Seems like fastestmirror does not sort mirrors by its download speed, but rather, by it connect() respond speed. That basically explains why it sometimes pick a mirror with slow download speed as fastest. As fast respond to connect(), doesn't necessarily means the mirror have higher upload speed bandwidth.

So, I changed a bit of that behavior. Altered the code to download the repomd.xml, , see how fast the download went, and sort the mirrors according to that. For those who interested, my patch is here: fastestmirror-repomd-download-speed-timing.patch.

(Yup2, I know repomd.xml is too small for evaluating bandwidth download speed accurately, but at least thats better than simply connect(), and other files might be too large resulting in the polling process slower)

If anybody want to improve on that patch, as usual, feel free to do so :D .
Written by Izhar Firdaus Follow Support
I'm a system architect, data engineer and developer advocate with passion in Free / Open Source software, entrepreneurship, community building, education and martial art. I take enjoyment in bridging and bringing together different FOSS technologies to help businesses and organizations utilize IT infrastructure to aid and optimize their business and organizational process.

UTP's new course registration system not cross browsers compatible

Sometimes I wonder why I'm such a freetard. http://n2.nabble.com/UTP-Prism-is-NOT-Cross-Browser-Compliant-td1594436.html- Izhar Firda...

In old blog, Nov 30, 2008

« Previous Post

CompizFusion DesktopEffects Dialog

A little something I wrote last night.So, what it do?. Simply a little workaround of the problem Fedora users had for quite a long ti...

In old blog, Dec 26, 2008

Next Post »