- November 11, 2008
Well i guess you all sometime have noticed that the ports system isn’t so smart about which ftp server to start downloading distributions from. Quite often i have noticed that the multi megabyte file i’m downloading comes from japan. Not optimal at all…
Well today Wesley Shields pointed out on freebsd-ports that there is a solution to this problem. There is a port under ports-mgmt called fastest_sites that is neat to have. fastest_sites sorts the MASTER_SITE definitions depending on the round-trip time for the tcp-handshake. (ping isn’t really useful since it could be blocked out by firewall rules)
So lets go ahead and install this nice tool:
# cd /usr/ports/ports-mgmt/fastest_sites
# make install
Now you have installed the fastest_sites program, so run it to generate the sorted list of master sites:
# fastest_sites > /usr/local/etc/ports_sites.conf &
This step will take some time, there is a lot of sites to probe… While waiting add the following line to /etc/make.conf:
Now each time you install a port make will choose from the list sorted after temporal proximity instead of just guessing randomly.
Quite often this makes a great difference! Especially if you happen to be close to one of the listed master sites.
Naturally master sites come and go, but also the network load and topology might change so run fastest_ports now and then to keep your own database up to date.
The orginal site for this application can be found here at Jodan Sissel’s site semicomplete.