Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the command line file download accelerators for Linux

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail what are the command line file download accelerators about Linux, and the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Install Axel (Command Line download Accelerator for Linux)

As we mentioned earlier, axel is more than just another download tool. It accelerates HTTP and FTP downloads by retrieving files from the target using multiple connections, and can be configured to use multiple images.

If that's not enough to motivate you to try it, let's add the following: axel supports automatic termination and recovery of connections that do not respond or return any data after a given time.

In addition, if you have permission to do so, you can use axel to open multiple simultaneous FTP connections to a server to multiply the bandwidth allocated for each connection.

If this is not allowed or if you are not sure, you can open connections to multiple servers and download them from all servers at the same time.

Last but not least, axel differs from other Linux download accelerators in that it puts all the data in one file when it downloads, rather than writing the data to separate files and adding them later.

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

Linuxmi@linuxmi:~/www.linuxmi.com$ yum install epel-release linuxmi@linuxmi:~/www.linuxmi.com$ yum install axel

In Fedora, it is available from the default repository.

Linuxmi@linuxmi:~/www.linuxmi.com$ yum install axel linuxmi@linuxmi:~/www.linuxmi.com$ dnf install axel [above Fedora 23]

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

Linuxmi@linuxmi:~/www.linuxmi.com$ sudo aptitude install axel

On Arch Linux and related distributions, such as Manjaro Linux and OpenSUSE Linux, you can install axel directly using the following command:

Linuxmi@linuxmi:~/www.linuxmi.com$ sudo pacman-S axel [on Arch/Manjaro] linuxmi@linuxmi:~/www.linuxmi.com$ sudo zypper install axel [on OpenSUSE] configure Axel-Linux download Accelerator

You can configure axel with / etc/axelrc and pass the other options you need on the command line when calling it. This configuration file has been documented in detail, and we will list the most useful options here:

Reconnect_delay is the number of seconds that axel will wait before attempting to start a new connection to the server again.

Max_speed is self-evident. The value is in bytes per second (BPRS). After considering the available bandwidth, you may need to set this variable to the appropriate value. This will help you prevent axel from consuming a lot of bandwidth when downloading.

Important: note that the actual maximum download rate depends on your network connection-needless to say, setting max_speed to 5 MB/s won't help if your Internet connection has a maximum speed of 1.22 MB/s. As you can see in the following example-I just left that value to illustrate this point).

Num_connections is the maximum number of connections that axel will attempt to start. The recommended value (4) is sufficient in most cases and is mainly given out of respect for other FTP users. 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 automatically resume.

Http_proxy allows you to set up a proxy server if 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, and axel should not attempt to access through proxies. This setting is optional.

Buffer_size represents the maximum number of bytes that can be read from all current connections at a time.

Verbose allows you to choose whether to print messages related to downloads on the screen. If you want to disable it, set it to 0; if you still want to view the message, set it to 1.

If you have more than one interface, you can use the interface to list the network interfaces that can access Internet. If it is not explicitly set, axel uses the first interface in the routing table.

More configuration options use the following commands:

Linuxmi@linuxmi:~/www.linuxmi.com$ axel-help

If you look closely, you will find that most of the command line options are similar to those in the configuration file. In addition, the-o (- output) option allows you to specify the output file name.

If used, it overwrites the source file name. If you set any command line options, they override those set in the configuration file.

How to download files faster using Axel in Linux

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

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

From: https://www.linuxmi.com/axel-linux-xiazai.html

Now, we will use wget and axel to compare the download times of HTTP and FTP links. You can choose any file of any size, but for simplicity, we will download 100 MB files from the following location:

Ftp://speedtest:speedtest@ftp.otenet.gr/test100Mb.db

Http://speedtest.ftp.otenet.gr/files/test100Mb.db

Compare FTP and Axel download times

Use wget for FTP downloads:

100.00m average 205KB/s time 8m 7s s

Linuxmi@linuxmi:~/www.linuxmi.com$ wget ftp://speedtest:speedtest@ftp.otenet.gr/test100Mb.db

Download using axel's FTP:

Downloaded 100 megabytes for 37 second (s). (average 2734.36 KB/s)

Linuxmi@linuxmi:~/www.linuxmi.com$ axel- n 10-- output=axel-test100Mb.db ftp://speedtest:speedtest@ftp.otenet.gr/test100Mb.db

Compare HTTP and Axel download times

HTTP downloads using wget (average 226 KB/s):

Linuxmi@linuxmi:~/www.linuxmi.com$ wget http://speedtest.ftp.otenet.gr/files/test100Mb.db

HTTP downloads using axel (average 2458.08 KB/s):

Linuxmi@linuxmi:~/www.linuxmi.com$ axel- n 10-- output=axel-test100Mb.db http://speedtest.ftp.otenet.gr/files/test100Mb.db

As you can see from the results of the tests we conducted above, axel can greatly speed up FTP or HTTP downloads.

On the Linux command line file download accelerator has shared here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report