Axel - Command Line File Download Accelerator for Linux

Make a fortune with your little hand, give it a thumbs up!

If you're the type of person who likes to download and try out multiple Linux distributions, we're sure you'll welcome with open arms a download accelerator that does what it says - one that does what it says.

In this guide [1] we'll introduce you to Axel, a lightweight wget clone with no dependencies (except gcc and makeutils).

alt

Although its description indicates that it is particularly suitable for byte-critical systems, axel can be installed anywhere and can be used not only to download multiple files simultaneously over HTTP/FTP links, but also to speed them up.

Install

As we mentioned before, axel is not just another download tool. It speeds up HTTP and FTP downloads by using multiple connections to retrieve files from the target, and can also be configured to use multiple mirrors.

If that's not enough motivation to give you a try, let's add that axel supports automatically aborting and resuming connections that are unresponsive or return no data after a given period of time.

Also, if you have permission to do so, you can utilize axel to open multiple simultaneous FTP connections to a server to increase the allocated bandwidth per connection.

If you're not allowed to do this or are unsure, you can instead open multiple connections to separate servers and download from all of them simultaneously.

Last but not least, what makes axel different from other Linux download accelerators is that it puts all the data in one file while downloading instead of writing the data to separate files and joining them at a later stage.

In CentOS/RHEL 8/7 you need to enable EPEL repository to install axel:

yum install epel-release
yum install axel

In Fedora it is available from the default repositories.

yum install axel   
dnf install axel   [On Fedora 23+ releases]

In Debian and its derivatives such as Ubuntu and Linux Mint, you can directly use aptitude to install axel:

aptitude install axel

On Arch Linux and related distributions (such as Manjaro Linux and OpenSUSE Linux), you can install axel directly:

sudo pacman -S axel       [On Arch/Manjaro]
sudo zypper install axel  [On OpenSUSE]

configuration

您可以使用 /etc/axelrc 配置 axel 并在调用它时在命令行中传递更多所需的选项。配置文件有详细记录,但我们将在此处查看最有用的选项:

  • reconnect_delay 是 axel 在再次尝试启动与服务器的新连接之前等待的秒数。
  • max_speed 值以每秒字节数 (B/s) 为单位。考虑到可用带宽后,您可能希望将此变量设置为适当的值。这将帮助您防止 axel 在下载时消耗大量带宽。

重要提示:请注意,实际最大下载速率将取决于您的 Internet 连接

  • num_connections 是 axel 将尝试启动的最大连接数。推荐值 (4) 对于大多数情况已经足够,主要是出于对其他 FTP 用户的尊重。请注意,某些服务器甚至可能不允许多个连接。
  • connection_timeout 指示 axel 在尝试中止并自动恢复之前等待接收响应的秒数。
  • http_proxy 允许您设置代理服务器,以防 HTTP_PROXY 环境变量尚未在系统范围内设置。此变量使用与 HTTP_PROXY (http://:PORT) 相同的格式。
  • no_proxy 是本地域的列表,以逗号分隔,axel 不应尝试通过代理访问这些域。此设置是可选的。
  • buffer_size 表示一次从所有当前连接读取的最大数量(以字节为单位)。
  • verbose 允许您选择是否在屏幕上打印与下载相关的消息。如果您想禁用它,请将其设置为 0,如果您仍想看到消息,请将其设置为 1。
  • 如果您有多个接口,interfaces 可以让您列出可以访问 Internet 的网络接口。如果未明确设置,axel 将使用路由表中的第一个接口。

If you look closely, you'll see that most of the command line options are similar to those in the configuration file. Additionally, the -o (–output) option allows you to specify an output filename.

If used, it will override the source filename. If you set any command-line options, they will override settings in the configuration file.

use

We will use the following settings in the configuration file (uncomment the corresponding line):

reconnect_delay = 20
max_speed = 500000
num_connections = 4
connection_timeout = 30
buffer_size = 10240
verbose = 1
alt

We will now compare download times for HTTP and FTP links using wget and axel. You can choose any file of any size, but for simplicity we'll download a 100 MB file from:

  • ftp://speedtest:[email protected]/test100Mb.db
  • http://speedtest.ftp.otenet.gr/files/test100Mb.db

FTP

FTP download using wget (average 459 KB/s):

wget ftp://speedtest:[email protected]/test100Mb.db
alt

axel

Use axel to download FTP (average 1181.43 KB/s):

axel -n 10 --output=axel-test100Mb.db ftp://speedtest:[email protected]/test100Mb.db
alt

As you can see in the test results we performed above, axel can significantly speed up FTP or HTTP downloads.

Summarize

In this article, we explain how to use axel, an FTP/HTTP download accelerator, and show how it can perform faster than other programs like wget because of its ability to open multiple connections to remote servers simultaneously.

Reference

[1]

Source: https://www.tecmint.com/axel-commandline-download-accelerator-for-linux/

This article is published by mdnice multi-platform

Guess you like

Origin blog.csdn.net/swindler_ice/article/details/130833561