yum fastestmirror selection

General support questions
Post Reply
reseni
Posts: 3
Joined: 2019/05/21 16:04:57

yum fastestmirror selection

Post by reseni » 2019/05/21 16:12:29

I installed new clean centos 7 server in the network
I have an official mirror, and just created server select mirror outside from my network

how timedhosts.txt is formed ??

Thanks!

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: yum fastestmirror selection

Post by avij » 2019/05/21 18:56:08

There may be various reasons why your preferred mirror did not get picked.
  • Is your official mirror listed on https://mirror-status.centos.org/ ? If not, it is not an official mirror and would need to be registered as an official public mirror.
  • Your server may use IPv6, but the mirror may support only IPv4. mirrorlist.centos.org only gives out IPv6-capable mirrors if the list is requested over IPv6. In this case the best fix would be to convince the mirror operator to add support for IPv6.
  • The mirror may be outdated. See the above mirror status link. Note that the status page shows only the status of the timestamp file in the root of the mirror, but mirrorlist.centos.org operates on a per-repository basis. Even if the mirror shows green, some of its repos may be somewhat behind.
  • fastestmirror measures the time it takes to resolve the mirror's IP address from DNS and the time to connect to the mirror's port 80 over IPv4. Sometimes there are random network delays, causing some other mirror to get the preference. This time (DNS lookup + connection time to port 80) is recorded in timedhosts.txt.
  • mirrorlist.centos.org outputs only 10 mirrors. If there are more than 10 in your region, mirrorlist.centos.org picks 10 mirrors at random to the candidate list.
  • Some other reason -- in this case it'd help to know the URL of the mirror so I'd be able to give you better answers.

reseni
Posts: 3
Joined: 2019/05/21 16:04:57

Re: yum fastestmirror selection

Post by reseni » 2019/05/21 19:16:40

thanks for an explanation. I think my issue caused by some changes BGP routing (
my mirror is mirrors.bytes.ua

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: yum fastestmirror selection

Post by TrevorH » 2019/05/21 19:18:20

The only way to force the use of a particular mirror is to use baseurl= and not mirrorlist=.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: yum fastestmirror selection

Post by avij » 2019/05/21 19:23:02

You can use http://miuku.net/tmp/testconnectiontime.py.txt to do some measurements of nearby mirrors. Note how DNS caching affects the results:

Code: Select all

$ python testconnectiontime.py mirrors.bytes.ua
mirrors.bytes.ua: 100.723982 ms
$ python testconnectiontime.py mirrors.bytes.ua
mirrors.bytes.ua: 47.858953 ms
$ python testconnectiontime.py mirrors.bytes.ua
mirrors.bytes.ua: 46.517134 ms
$ python testconnectiontime.py mirrors.bytes.ua
mirrors.bytes.ua: 46.897173 ms
$ python testconnectiontime.py mirrors.bytes.ua
mirrors.bytes.ua: 46.386957 ms
You can also use this to see the output of mirrorlist.centos.org (note the quotes, they are important):

Code: Select all

curl "http://mirrorlist.centos.org/?repo=os&arch=x86_64&release=7"

reseni
Posts: 3
Joined: 2019/05/21 16:04:57

Re: yum fastestmirror selection

Post by reseni » 2019/05/21 19:33:14

avij wrote:
2019/05/21 19:21:00
You can use http://miuku.net/tmp/testconnectiontime.py.txt to do some measurements of nearby mirrors. Note how DNS caching affects the results:

Code: Select all

$ python testconnectiontime.py mirrors.bytes.ua
mirrors.bytes.ua: 100.723982 ms
$ python testconnectiontime.py mirrors.bytes.ua
mirrors.bytes.ua: 47.858953 ms
$ python testconnectiontime.py mirrors.bytes.ua
mirrors.bytes.ua: 46.517134 ms
$ python testconnectiontime.py mirrors.bytes.ua
mirrors.bytes.ua: 46.897173 ms
$ python testconnectiontime.py mirrors.bytes.ua
mirrors.bytes.ua: 46.386957 ms
thanks for the advice!
I also tried this, and response time is jumping every time (channel not loaded)
domain is hosted in Cloudflare
avij wrote:
2019/05/21 19:23:02
You can also use this to see the output of mirrorlist.centos.org (note the quotes, they are important):

Code: Select all

curl "http://mirrorlist.centos.org/?repo=os&arch=x86_64&release=7"
my local (same LAN network) is on second place ((
ok, will digg further

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: yum fastestmirror selection

Post by avij » 2019/05/21 19:42:45

reseni wrote:
2019/05/21 19:37:32
my local (same LAN network) is on second place ((
ok, will digg further
For clarity, mirrorlist.centos.org does not know which one is the nearest so the position on the list does not matter much. After yum has retrieved these 10 mirrors which mirrorlist.centos.org thinks may be close to you, fastestmirror will do measurements for each mirror in that list, and picks the one with the lowest measured latency.

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: yum fastestmirror selection

Post by TrevorH » 2019/05/21 20:22:29

fastestmirror will do measurements for each mirror in that list, and picks the one with the lowest measured latency.
Based on a completely useless algorithm that's pretty much akin to deciding which is the fastest car by measuring the speed at which its remote door key unlock works.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply