If you are the kind of person who enjoys downloading and trying out several Linux distributions, we are sure you will welcome with open arms a download accelerator that talks the talk and walks the walk – one that does what its description says.
In this guide, we will introduce you to Axel, a lightweight wget clone that was no dependencies (other than gcc and makeutils).
Although its description states that it is specially fit for byte-critical systems, axel can be installed anywhere and used not only to download multiple files simultaneously over HTTP/FTP links but also to speed them up as well.
Installing Axel, a Command-Line Download Accelerator for Linux
As we mentioned earlier, axel is not just another download tool. It accelerates HTTP and FTP downloads by using multiple connections to retrieve files from the destination and can also be configured to use multiple mirrors as well.
If this wasn’t enough to get you motivated to try it out, let’s just add that axel supports automatic aborting and resuming connections that are unresponsive or not returning any data after a given period of time.
In addition, if you have permission to do so, you can leverage axel to open multiple simultaneous FTP connections to a server in order to multiply the allocated bandwidth per connection.
If you are not allowed to do this or are not sure about it, you can instead open multiple connections to separate servers and download from all of them at the same time.
Last but not least, axel differs from other Linux download accelerators in that it puts all the data in a single file at download time, as opposed to writing data to separate files and joining them at a later stage.
In CentOS/RHEL 8/7, you will need to enable the EPEL repository in order to install axel:
# yum install epel-release # yum install axel
In Fedora, it is available from default repositories.
# yum install axel # dnf install axel [On Fedora 23+ releases]
In Debian and derivatives such as Ubuntu and Linux Mint, you can install axel directly with aptitude:
# aptitude install axel
On Arch Linux and related distros such as Manjaro Linux and OpenSUSE Linux, you can install axel directly with:
$ sudo pacman -S axel [On Arch/Manjaro] $ sudo zypper install axel [On OpenSUSE]
Once the axel is installed, let’s dive in with both feet.
Configuring Axel – Linux Download Accelerator
You can configure axel using /etc/axelrc and pass further desired options in the command line when you invoke it. The configuration file is well documented but we will review the most useful options here:
reconnect_delay
is the number of seconds that axel will wait before trying again to start a new connection to the server.
max_speed
is self-explanatory. Value is given in bytes per second (B/s). You may want to set this variable to an appropriate value after considering your available bandwidth. This will help you to prevent axel from consuming a great deal of your bandwidth while it’s downloading.
Important: Please note that the actual maximum download rate will depend on your Internet connection – it goes without saying that setting max_speed
to 5 MB/s will not do anything if your Internet connection maxes out at 1.22 MB/s (as it was in my case, as you’ll see in the examples below – I just left that value to make the point).
num_connections
is the maximum number of connections that axel will attempt to start. The recommended value (4) is enough for most cases and is given mostly on the grounds of respect for other FTP users. Please note that some servers may not even allow multiple connections.
connection_timeout
indicates the number of seconds that axel will wait to receive a response before attempting to abort and resume it automatically.
http_proxy
allows you to set a proxy server in case the HTTP_PROXY environment variable has not been set system-wide. This variable uses the same format as HTTP_PROXY (http://:PORT).
no_proxy
is a list of local domains, separated by commas, which axel should not try to reach through a proxy. This setting is optional.
buffer_size
represents the maximum amount, in bytes, to read from all of the current connections at a time.
verbose
lets you choose whether download-related messages will be printed on the screen. Set this to 0 if you want to disable it, or 1 if you want to still see the messages.
interfaces
lets you list the network interfaces that have access to the Internet, should you have more than one. If this is not explicitly set, axel will use the first interface in the routing table.
Similar configuration options are available from:
# axel --help
If you look carefully, you will realize that most command-line options resemble those in the configuration file. Additionally, the -o
(–output) an option allows you to specify an output filename.
If used, it will override the source filename. If you set any of the command-line options, they will override those set in the configuration file.
How to Use Axel to Download Files Faster in Linux
We will use the following settings from the configuration file (uncomment the corresponding lines):
reconnect_delay = 20 max_speed = 500000 num_connections = 4 connection_timeout = 30 buffer_size = 10240 verbose = 1
We will now compare the download times from HTTP and FTP links using wget and axel. You can choose any file of any size, but for simplicity, we will download 100 MB files available from:
- ftp://speedtest:[email protected]/test100Mb.db
- http://speedtest.ftp.otenet.gr/files/test100Mb.db
Compare FTP and Axel Download Times
FTP download with wget (459 KB/s on average):
# wget ftp://speedtest:[email protected]/test100Mb.db
FTP download with axel (1181.43 KB/s on average):
# axel -n 10 --output=axel-test100Mb.db ftp://speedtest:[email protected]/test100Mb.db
Compare HTTP and Axel Download Times
HTTP download with wget (482 KB/s on average):
# wget http://speedtest.ftp.otenet.gr/files/test100Mb.db
HTTP download with axel (1178.93 KB/s on average):
# axel -n 10 --output=axel-test100Mb.db http://speedtest.ftp.otenet.gr/files/test100Mb.db
As you can see in the results from the tests we performed above, axel can accelerate an FTP or HTTP download significantly.
Summary
In this article, we have explained how to use axel, an FTP / HTTP download accelerator, and showed how it performs faster than other programs such as wget because it being able to open multiple simultaneous connections to remote servers.
Don’t Miss: 5 Most Popular Download Managers for Your Linux Systems
Don’t Miss: 10 Wget (Linux File Downloader) Command Examples in Linux
We hope that what we have shown here motivates you to try axel. Feel free to let us know if you have any questions or comments about this article using the form below. We always look forward to receiving feedback from our readers.