aria2 reuse existing connections option ubuntu
This article provides a direct answer to how the aria2 download utility can be configured to reuse existing network connections on Ubuntu. It identifies the specific command-line options required for HTTP and FTP protocols to enable connection persistence, which improves download speeds and reduces server overhead.
The primary option that allows aria2 to reuse existing connections to
the same host for HTTP downloads is --http-keep-alive. This
feature is enabled by default in most versions, but it can be explicitly
set to ensure persistent connections are maintained during a session.
When active, aria2 keeps the TCP connection open after a file download
completes, allowing subsequent requests to the same host to skip the
handshake process.
For FTP downloads, the specific option is
--ftp-reuse-connection. This flag tells aria2 to reuse the
control connection when downloading multiple files from the same FTP
server. Like the HTTP equivalent, this reduces latency and
authentication overhead when fetching multiple resources from a single
host.
To use these options in a command, append them to your aria2c call. For example:
aria2c --http-keep-alive=true http://example.com/file.zipFor permanent configuration, you can add these settings to your aria2
configuration file located at ~/.aria2/aria2.conf. Add the
following lines to ensure connection reuse is always active:
http-keep-alive=true
ftp-reuse-connection=true
Enabling these options is particularly useful when downloading multiple files from the same server or when using aria2 in a script that performs sequential downloads. It ensures that the network overhead is minimized by maintaining active sessions with the host.