Sunday, December 25, 2011

Download ports simultaneously with multiple connections

By default, ports uses 1 connection to download and thus unbearably slow when a server rate limit the connection. Alternatively, we can tell ports to use external utility in order to open multiple connections and download simultaneously.

Firstly, install the utility "axel" by :

# cd /usr/ports/ftp/axel ;make install clean

Next, tell ports to use the external utility to perform downloading task. Insert the following lines into /etc/make.conf :

# vim /etc/make.conf
FETCH_CMD=axel
FETCH_BEFORE_ARGS= -n 4 -a
DISABLE_SIZE=yes

The parameter "-n 4" is to tell "axel" break the file into 4 parts and download simultaneously; "-a" is to show an alternate download progress bar. Do take note that, DO NOT set the simultaneously connection ("-n") too many as it takes time for the server to tear down the connection after the downloads terminate. This could block other people from downloading it. After all, these software are the "Best" & "Freely" available to everyone.

Ciao !!!

Reference:
http://scratching.psybermonkey.net/2009/09/freebsd-download-ports-simultaneously.html

No comments: