Ubuntu 24.04LTS で axel を使って高速ダウンロードする
以前に以下のメモを書きました。
今回は Ubuntu に axel をインストールしてみました。
検証環境¶
対象 | バージョン |
---|---|
Ubuntu | 24.04.2 LTS |
axel | 2.7.13 |
インストール¶
axel の GitHub ページ では最新が 2.7.14 ですが、Ubuntu 24.04LTS の標準リポジトリではひとつ前の 2.7.13 が提供されていました。
# apt info axel
Package: axel
Version: 2.17.13-1build2
Priority: optional
Section: universe/web
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Joao Eriberto Mota Filho <eriberto@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 218 kB
Depends: libc6 (>= 2.38), libssl3t64 (>= 3.0.0)
Homepage: https://github.com/axel-download-accelerator/axel
Download-Size: 61.1 kB
APT-Sources: http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
Description: light command line download accelerator
Axel tries to accelerate the downloading process by using multiple
connections for one file, similar to DownThemAll and other famous
programs. It can also use multiple mirrors for one download.
.
Using Axel, you will get files faster from Internet. So, Axel can
speed up a download up to 60% (approximately, according to some tests).
.
Axel supports HTTP, HTTPS, FTP and FTPS protocols.
.
Axel tries to be as light as possible, so it might be useful as a
wget clone (and other console based programs) on byte-critical systems.
今回はこの 2.7.13 をインストールすることにします。 apt でインストールします。
apt -y install axel
使い方¶
指定された URL からファイルをダウンロードする場合は以下のように実行します。 デフォルトでは「4 コネクション」でダウンロードしようとするようです。
axel [URL]
コネクション数を指定する場合は -n
オプションを指定します。 例えば「10 コネクション」にするなら -n 10
のように指定します。 但し、コネクション数を増やせばその分、サーバ側の負担が上がるかもしれません。 また、コネクション数を増やしたとしてもボトルネックがローカル I/O にある場合はあまり効果が無いかもしれません。 この辺りのチューニングは axel に限らない問題ですので、環境に合わせて考慮・調整します。
axel -n 10 [URL]
証明書の検証を実施せず、自己証明書などの警告を無視させるには -k
オプションを指定します。
axel -k [URL]
curl と axel の実行結果を比較する¶
インターネット経由で 600MB のファイルをダウンロードした際にかかった時間を計測してみました。 少なくても今回の計測結果に限っては「curl よりも axel の方が早い」という結果になりました。
コマンド | 1 回目 | 2 回目 | 3 回目 | 平均 |
---|---|---|---|---|
curl | 43 秒 | 45 秒 | 62 秒 | 50 秒 |
axel | 38 秒 | 33 秒 | 26 秒 | 32 秒 |
参考¶
axel のヘルプ¶
# axel --help
Axel 2.17.13 (linux-gnu)
Usage: axel [options] url1 [url2] [url...]
--max-speed=x -s x Specify maximum speed (bytes per second)
--num-connections=x -n x Specify maximum number of connections
--max-redirect=x Specify maximum number of redirections
--output=f -o f Specify local output file
--search[=n] -S[n] Search for mirrors and download from n servers
--ipv4 -4 Use the IPv4 protocol
--ipv6 -6 Use the IPv6 protocol
--header=x -H x Add HTTP header string
--user-agent=x -U x Set user agent
--no-proxy -N Just don't use any proxy server
--insecure -k Don't verify the SSL certificate
--no-clobber -c Skip download if file already exists
--quiet -q Leave stdout alone
--verbose -v More status information
--alternate -a Alternate progress indicator
--percentage -p Print simple percentages instead of progress bar (0-100)
--help -h This information
--timeout=x -T x Set I/O and connection timeout
--version -V Version information
Visit https://github.com/axel-download-accelerator/axel/issues to report bugs