This guide explains how to configure global upload and download speed limits for rTorrent and ruTorrent.
By default, both upload and download speed limits are set to 0 (Unlimited).
Some ruTorrent plugins, such as RatioGroup and Channels, require global speed limits to be configured before their own speed limiting features can work correctly.
Configuring Global Limits for RatioGroup and Channels
If you only want to enable speed limiting for the RatioGroup or Channels plugins, run the following command via SSH:
sed -i "s/'MAX_SPEED', 0/'MAX_SPEED', 1024*1024*300/" ~/www/$(whoami).$(hostname)/$(whoami)/rutorrent/plugins/throttle/throttle.php
This configures the maximum global speed to approximately 3 Gbps.
No rTorrent restart is required. Simply refresh the ruTorrent page.
After refreshing, the following values in Settings → Connection will be changed from unlimited to 307200 kB/s:
Global maximum upload rate (kB/s): 307200 Global maximum download rate (kB/s): 307200
RatioGroup and Channels will now be able to apply their own upload speed limits correctly.
Configuring Permanent Global Limits
If you want to permanently limit the maximum upload or download speed of rTorrent itself, edit your .rtorrent.rc configuration.
The following two directives control the global speed limits:
#throttle.global_down.max_rate.set_kb = 0 #throttle.global_up.max_rate.set_kb = 0
Remove the leading # from the line you want to enable and replace 0 with the desired speed limit in kB/s.
After saving the file, restart rTorrent for the changes to take effect.
Once restarted, the configured limits will also be visible in the ruTorrent connection settings.
Unlike changes made through the ruTorrent WebUI, limits configured in .rtorrent.rc are permanent and remain in effect after every rTorrent restart.
Restoring the Default ruTorrent Limit
If you want to restore the default ruTorrent throttle configuration (Unlimited), run:
sed -e "s/'MAX_SPEED'.*/'MAX_SPEED', 0);/" ~/www/$(whoami).$(hostname)/$(whoami)/rutorrent/plugins/throttle/throttle.php
Refresh the ruTorrent page after executing the command.
Removing Permanent Limits
If you configured limits in .rtorrent.rc and want to remove them, simply comment out both directives again by adding the # character at the beginning of each line:
#throttle.global_down.max_rate.set_kb = 0 #throttle.global_up.max_rate.set_kb = 0
Restart rTorrent and the upload and download limits will return to the default unlimited values.
Use the ruTorrent throttle.php modification only when you need plugins such as RatioGroup or Channels to control upload speeds. For permanent global bandwidth limits, always configure .rtorrent.rc instead.