Configure aria2 Socket Receive Buffer Size on Ubuntu
This article provides a quick guide on configuring the socket receive buffer size for aria2 on Ubuntu Linux. It covers both temporary command-line arguments and permanent configuration file adjustments to help you optimize network throughput for your downloads.
Using the Command Line
To set the socket receive buffer size for a single session, use the
--socket-recv-buffer-size option when running aria2c. You
can specify the size using K, M, or G suffixes for kilobytes, megabytes,
or gigabytes respectively.
aria2c --socket-recv-buffer-size=10M https://example.com/file.zipThis setting applies only to the current download process and will not persist after the command finishes.
Using the Configuration File
To make the change permanent, edit the aria2 configuration file. On
Ubuntu, this file is typically located at
~/.aria2/aria2.conf. If the file does not exist, you can
create it.
Open the file using a text editor:
nano ~/.aria2/aria2.confAdd or modify the following line to set your desired buffer size:
socket-recv-buffer-size=10M
Save the file and exit the editor. If you are running aria2 as a daemon or service, restart it to apply the new settings.
Understanding Buffer Values
Setting the value to 0 allows the operating system to determine the optimal buffer size automatically. If you experience slow download speeds or connection timeouts, increasing this value manually may improve performance on high-latency networks. Ensure you have sufficient system memory before allocating large buffer sizes.