Should preferred_hosts honour relative ordering within the line?
Saj Goonatilleke
sg at redu.cx
Mon Dec 23 15:55:03 UTC 2024
Hello!
My macports.conf looks as follows.
-- 8< --
% grep ^preferred_hosts /opt/local/etc/macports/macports.conf
preferred_hosts *.au.*.macports.org mirror.fcix.net *.jp.*.macports.org
-- >8 --
I expected MacPorts to try the AARNet archive mirror first (au),
then fall back to the FCIX mirror,
then fall back to the JAIST mirror (jp),
then try some other mirrors at random-ish,
or give up completely (and build from source).
Instead, the first request is always sent to the FCIX mirror.
The AARNet mirror is only consulted if we miss on FCIX,
or if the FCIX mirror is elided from preferred_hosts.
Is this behaviour intentional? Would you be open to change?
-- 8< --
% sudo port install socat
---> Computing dependencies for socat
---> Fetching archive for socat
---> Attempting to fetch socat-1.8.0.1_0.darwin_21.x86_64.tbz2 from http://mirror.fcix.net/macports/packages/socat
---> Attempting to fetch socat-1.8.0.1_0.darwin_21.x86_64.tbz2 from http://aarnet.au.packages.macports.org/pub/macports/packages/socat
---> Attempting to fetch socat-1.8.0.1_0.darwin_21.x86_64.tbz2 from https://kmq.jp.packages.macports.org/socat
---> Fetching distfiles for socat
---> Attempting to fetch socat-1.8.0.1.tar.bz2 from http://mirror.fcix.net/macports/distfiles/socat
---> Verifying checksums for socat
---> Extracting socat
[...]
-- >8 --
I will try to explain why an ordered set would be helpful. MacPorts net
perf from Australia is a bit rough. We are a long way from everyone
else in the world. The Fastly CDN consistently wins the ping race,
however throughput on this CDN, from its cold Sydney edge, is poor.
Australian users must currently set the preferred_hosts override.
The FCIX mirror in Fremont offered us the best performance for a long
time, and so, until recently, my configuration looked like this:
preferred_hosts mirror.fcix.net *.jp.*.macports.org
A new AARNet archive mirror was added this month. This mirror is the
only MacPorts mirror in Australia. Performance is very good from here.
(After all, we don't need to transit an ocean any more.) However,
I have occasionally observed misses on some new archive files.
It would therefore seem reasonable to give first preference to the
AARNet mirror and fall back to some other mirror on a miss.
Here's the rub. If we miss on AARNet, there are few practical options
left. FCIX is good from here. JAIST is OK from here. Beyond that it
is like falling off a cliff: we are gonna be waiting a while. It is
therefore not enough to list only the AU mirror in preferred_hosts,
but if we also list our preferred fall-back mirrors, then MacPorts
will bypass the AU mirror and send most traffic over the Pacific.
More information about the macports-users
mailing list