How to Limit Download Speed in aria2 Session?
This article provides a quick, actionable guide on how to restrict the maximum download speed for a specific aria2 session. Whether you are running the utility via the command line or managing it through a configuration file, you will learn the exact flags and parameters needed to cap bandwidth usage temporarily or permanently. By managing these limits, you can prevent aria2 from consuming your entire network bandwidth, ensuring other applications remain responsive.
Setting the Limit via Command Line
The quickest way to set a maximum download speed for a specific aria2
session is by passing the --max-download-limit flag
directly when starting the command in your terminal. This limit will
only apply to that specific instance and will expire as soon as the
session closes.
You can specify the speed using standard size suffixes:
- K or k for kilobytes (e.g.,
1024Kor1M) - M or m for megabytes
Here is the standard command structure:
aria2c --max-download-limit=500K "YOUR_DOWNLOAD_URL"In this example, the download speed for the session is strictly capped at 500 KB/s. If you want to allocate a larger pipe, such as 2 megabytes per second, you would format it like this:
aria2c --max-download-limit=2M "YOUR_DOWNLOAD_URL"Setting the Limit via Configuration File
If you prefer not to type the flag every time but still want a
specific session—like a daemon session—to respect a bandwidth cap, you
can define this rule within your aria2 configuration file (typically
named aria2.conf).
Add the following line to your configuration file:
max-download-limit=1M
When you want to run a session using these specific configuration
rules, point aria2 to that file using the --conf-path
flag:
aria2c --conf-path=/path/to/your/aria2.conf "YOUR_DOWNLOAD_URL"Changing Limits Dynamically During a Session
If you have an active aria2 session running as a background daemon
with the Remote Procedure Call (RPC) feature enabled, you do not need to
restart the session to change the speed limit. You can alter the maximum
download speed on the fly using the
aria2.changeGlobalOption method via an RPC client or a
simple curl command.
Here is an example of a JSON-RPC request sent via curl
to dynamically change the session limit to 300 KB/s:
curl http://localhost:6800/jsonrpc -d '{"jsonrpc":"2.0","id":"qwer","method":"aria2.changeGlobalOption","params":[{"max-download-limit":"300K"}]}'By utilizing these three methods—command-line flags, configuration files, or RPC inputs—you gain total control over how much bandwidth any given aria2 session is allowed to use.