UK user assigned to Japan mirror for pkg

I am UK based and only getting 147.5kB/s transfer rate when using pkg install despite being on a 1 gigabit connection (tested using speedtest-go):
✓ Test Server: [57318] 87.70km Slough (United Kingdom) by Zzoomm Plc
✓ Latency: 2.146761ms Jitter: 199.269µs Min: 1.878701ms Max: 2.522646ms
✓ Packet Loss Analyzer: Running in background (<= 30 Secs)
✓ Download: 928.93 Mbps (Used: 1174.16MB) (Latency: 30ms Jitter: 13ms Min: 17ms Max: 54ms)
✓ Upload: 896.61 Mbps (Used: 1143.77MB) (Latency: 24ms Jitter: 7ms Min: 16ms Max: 41ms)
✓ Packet Loss: 0.00% (Sent: 268/Dup: 0/Max: 267)

Following the advice on another thread: pkg download speed too low
Please report which mirror you're getting by going to http://pkg.freebsd.org/

On visiting https://pkg.freebsd.org/ it shows me that I am on the Japan mirror.
This is pkg0.kwc.FreeBSD.org - a Japan regional mirror for pkg(8).

I tested my IP with the Maxmind demo and it returned:
United Kingdom (GB), Europe

Any suggestions? How do I force the use of a Europe mirror? Thanks.
 
How do I force the use of a Europe mirror?
You can replace FreeBSD's geographic mirror URL to one that you get good speeds with. But keep in mind that mirors sometimes may have hard times, they can became poor at times.
Code:
% cat /etc/pkg/FreeBSD.conf
#
# To disable this repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file:
#
#   mkdir -p /usr/local/etc/pkg/repos
#   echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#

FreeBSD: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/quarterly",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
FreeBSD-kmods: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly_${VERSION_MINOR}",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
 

Very nice!

Code:
$ fastest_pkg

pkg0.bbt.freebsd.org: 488.1 kB/s
pkg0.bme.freebsd.org: 0.0 B/s
pkg0.bra.freebsd.org: 793.0 kB/s
pkg0.kul.freebsd.org: 2.1 MB/s
pkg0.kwc.freebsd.org: 97.4 kB/s
pkg0.nyi.freebsd.org: 4.0 MB/s
pkg0.pao.freebsd.org: 2.3 MB/s
pkg0.sjb.freebsd.org: 5.6 MB/s
pkg0.syd.freebsd.org: 518.8 kB/s
pkg0.tuk.freebsd.org: 2.1 MB/s
pkg0.twn.freebsd.org: 0.0 B/s
pkg0.jinx.freebsd.org: 1.1 MB/s

Fastest:
pkg0.sjb.freebsd.org: 5.6 MB/s

Write configuration:
mkdir -p /usr/local/etc/pkg/repos/
echo 'FreeBSD: { url: "http://pkg0.sjb.freebsd.org/${ABI}/quarterly", mirror_type: "NONE" }' \
    > /usr/local/etc/pkg/repos/FreeBSD.conf

You can replace FreeBSD's geographic mirror URL to one that you get good speeds with. But keep in mind that mirors sometimes may have hard times, they can became poor at times.

Will bear that in mind, thank you.

Edit: Thanks all, I updated to the Sweden mirror and now get very fast speeds.
Fetching data.pkg: 100% 10 MiB 10.4MB/s 00:01

Here's the config I applied.
/usr/local/etc/pkg/repos/FreeBSD.conf
Code:
FreeBSD: { url: "http://pkg0.sjb.freebsd.org/${ABI}/quarterly", mirror_type: "NONE" }
 
If you're on 14.3 there's a second "FreeBSD-kmods" repository, I'm not sure if ports-mgmt/fastest_pkg is already aware of that. But it's fairly easy to add manually once you know your 'fastest' mirror.
 
The line should be in /etc/pkg/FreeBSD.conf.

In case it's not, the stanza is

FreeBSD-kmods: {
url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly_${VERSION_MINOR}",
signature_type: "fingerprints",
fingerprints: "/usr/share/keys/pkg",
enabled: yes
}

I'm not sure if you mean to redo the whole FreeBSD.conf but this is what SirDice is talking about.
 
Yeah FreeBSD has geo routing issues, I posted about it on the reddit. When downloading FreeBSD 15 ISO I was getting DSL speeds from a slow swedish mirror, yet there is much faster EU mirrors in the mirror list, including UK one's.

At least with the pkg system it can be overridden as above.
 
I think you need to persevere. From some cellular mobile carriers in some (east coast) locations in Australia, the Japan mirror used to give the best speeds. I suspect there was a congestion point favouring Japan that got alleviated, because the Sydney mirror is now usually best. You would expect that because cellular mobile data IP connections generally pop out of the carriers' privately routed enclaves in capital cities.

I'm currently in France on an Orange terrestrial Internet connection, which I think is fiber, and pkg0.sjb.FreeBSD.org in Sweden (18 hops, and about 2000 km away) is outstanding (30 MB/sec).
 
Back
Top