Can aria2 download a file from multiple sources?
Yes, aria2 is fully capable of downloading a single file from multiple sources simultaneously. As a lightweight, multi-protocol command-line utility, it can combine bandwidth from different mirrors, servers, or even entirely different protocols (such as HTTP, FTP, SFTP, and BitTorrent) to download one file faster. By splitting the target file into segments, aria2 fetches separate pieces from each designated location at the same time and seamlessly reassembles them upon completion.
How Multi-Source Downloading Works in aria2
When you provide aria2 with multiple URLs for the same file, it utilizes segmented downloading. The engine divides the file size into uniform chunks. If you have provided two different mirrors, aria2 will assign specific chunk ranges to Mirror A and other chunk ranges to Mirror B.
This process isn’t limited to a single protocol. For instance, aria2 can download parts of a file from an HTTP web server while concurrently pulling other parts of the exact same file from a BitTorrent swarm. While it downloads from the HTTP/FTP sources, it can even upload those finished segments to the BitTorrent peers, maximizing network efficiency.
Command-Line Examples
To download a single file from multiple sources via the command line, you simply append the various URLs to the end of your command, separated by a space.
aria2c "http://server1.com/file.zip" "http://server2.com/file.zip" "ftp://server3.com/file.zip"If you prefer to organize your links inside a text file, you can utilize an input file. In this setup, multiple sources for a single file must be placed on the exact same line, separated by a TAB character.
http://server1.com/file.zip http://server2.com/file.zip ftp://server3.com/file.zip
You can then execute the download by pointing aria2 to that list:
aria2c -i download_list.txtImportant Settings for Multi-Source Performance
To ensure aria2 distributes the load properly across your sources, you need to be aware of two specific parameters:
--split(or-s): This defines the total number of connections or splits used for the file download. If you have 3 sources but your split value is set to 1, aria2 will only pull from the first available source. To utilize multiple sources, ensure that the split number is equal to or greater than the number of sources.--min-split-size(or-k): This determines the minimum size of a segment. By default, this is often set to 20MB. If a file is smaller than twice the minimum split size, aria2 will refuse to split it, causing it to fall back to a single source connection regardless of how many URLs you supplied.
Adjusting these settings ensures that the application successfully splits the workload across all available mirrors, allowing you to maximize your total available internet bandwidth.