Does aria2 Support Segmented Downloading and How to Set Size?
This article provides a quick overview of aria2’s capabilities regarding segmented downloading, explaining how it splits files into smaller chunks to accelerate download speeds. You will learn the exact command-line options required to enable multi-connection downloads and how to explicitly define the minimum segment size for your transfers.
Segmented Downloading in aria2
aria2 fully supports downloading a single file in multiple segments (also known as connections or chunks) simultaneously. By downloading different parts of a file at the same time, aria2 maximizes your bandwidth utilization and significantly reduces overall download times.
To achieve segmented downloading, aria2 uses two primary parameters that work in tandem:
- The number of connections allowed per server.
- The minimum size required to split a file into a new segment.
How to Define the Segment Size and Connection Count
To customize your segmented downloads, you need to use the
-s (split) and -k (min-split-size) options in
your command line.
1. Setting the Number of Segments
The -s option determines the number of connections or
splits to use for a single download. For example, to split a download
into 5 segments, you would use:
aria2c -s 5 "URL"
2. Setting the Minimum Segment Size
The -k or --min-split-size option defines
the minimum size of a segment. aria2 will only split a file into a new
segment if the remaining size of the chunk is larger than the value you
specify. This prevents the utility from creating thousands of tiny,
inefficient connections for smaller files.
You can specify the size using numbers followed by a unit suffix, such as M for megabytes or G for gigabytes. The default minimum split size is usually 20M.
For example, if you want to set the minimum segment size to 10MB, you would use:
aria2c -k 10M "URL"
Combining the Options for Maximum Speed
To successfully force aria2 to download a file in segments, both conditions must be met. If your file is 50MB and you ask for 5 splits with a minimum split size of 20M, aria2 will only create 2 segments ($50 / 20 = 2.5$) instead of the 5 you requested.
Here is an example of how to combine the commands to download a large file using 16 connections, with a defined minimum segment size of 5MB:
aria2c -s 16 -x 16 -k 5M "URL"
Note: The
-xoption (--max-connection-per-server) is included here because aria2 caps the connections to a single server at 1 by default. Setting-x 16allows aria2 to actually open those 16 concurrent pathways to the same host.