Pkg and freebsd website too slow (for me)

I started to install freebsd memstick iso from the offical freebsd website it took 2 hours to download 1.1GB file, I loaded into a usb and installed it but packages I install with pkg take forever, I get very decent internet speed with other package managers or websites or downloads but for some reason freebsd seems to be too slow. I assume this is a problem I have as it is not being mentioned in other places but I coudn't fix it. I tried to add other mirrors of freebsd but it didn't change anything.
 
Any chance you are on some kind of "dual-stack-lite" or other non-RFC-compliant connection where your ISP breaks IPv6 connectivity?
Try setting ip_version: 4 in /usr/local/etc/pkg/repo/FreeBSD.conf (if it doesn't exist, just copy it over from /etc/pkg/FreeBSD.conf, but don't edit that file, because it may be overwritten by updates)

I've fought with the exact same issue last week where pkg always tried to first use IPv6 (because the network/uplink was running v4 and v6) which failed and/or was horribly slow (sub-100kbit/s). Using IPv4 solved that immediately. Upon further investigation I found the v6 address seen from the outside didn't even remotely matched the prefix the ISP (and/or their CPE) was handing out to the clients; so they tamper with the IPv6 stack in some way that messes up pkg and other services/protocols, as the person stated he also had to enforce IPv4 for some online games.
 
Get a ping from the site and check the time:

ping -c 5 freebsd.org

From the beginning, I was facing the problem of download speed from the mirrors. My download speed often reached under 10 kilobytes!!! To install Qt, I left my system on from night to morning! I though this problem is due to the DNS disruption of ISPs. Anyway, I completely solved this problem by changing the mirrors, and now it only takes a few seconds to download each package.

Change server of pkgs:
Open /etc/pkg/FreeBSD.conf

You should see:
url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly",


Change highlighted text (pkg.FreeBSD.org) to one of these:
Code:
pkg.eu.FreeBSD.org
pkg.us-east.FreeBSD.org
pkg.us-west.FreeBSD.org

Finally update mirrors:
# pkg update -f
 
Get a ping from the site and check the time:
Ping will only tell you a (momentary) round-trip time, IOW the latency on the path, it will tell you nothing about the throughput, which is much more relevant for download speeds except when downloading many very small files.

I would assume the ports-mgmt/fastest_pkg suggested by SirDice will do a much better measurement.
 
I used this method before, but the problem was not solved.
Ok, I didn't test it (I'm using my own local repository, so never have this specific problem) and also didn't look at the implementation of that script. Just saying, measuring only latency isn't conclusive for expected download speeds.
 
Ok, I didn't test it (I'm using my own local repository, so never have this specific problem) and also didn't look at the implementation of that script. Just saying, measuring only latency isn't conclusive for expected download speeds.
I even used a VPN and the speed didn't change much. Lately the main server has been completely down for me.
Thanks for the tips
 
Just two things about this:
first, thank you SirDice for the suggestion :), and second is about choosing a specific mirror and the use of pkg(8) with https instead of plain http: if you use https and specify a mirror in your config file, pkg(8) will complain due to an authentication error because mirrors' certificates report pkg.freebsd.org as domain name instead of the one of the mirror you want to connect to. To workaround the problem, an entry for pkg.freebsd.org can be added to /etc/hosts, assigning the IP address of the choosen mirror to it (shoud be static I hope).
 
I did change my ip version to 4, did update the mirrors rebooted and tried fastest_pkg but the highest download I get is 230 kB/s.
 
Back
Top