Note
This repository is a fork of itschasa/speedrr.
Change your torrent client's upload speed dynamically, on certain events such as:
- When a Plex/Jellyfin/Emby stream starts
- Time of day and day of the week
- More coming soon!
Change your torrent client's download speed dynamically, on certain events such as:
- Time of day and day of the week
- More coming soon!
This script is ideal for users with limited upload speed, however anyone can use it to maximise their upload speed, whilst keeping their Plex/Jellyfin/Emby streams buffer-free! Also great to adjust the download rate during the day, in case the bandwidth is needed for something else!
- Multi-server support for Plex, Jellyfin, Emby, and Tautulli.
- Supports qBittorrent and Transmission.
- Multi-torrent-client support.
- Bandwidth is split between them, by number of downloading/uploading torrents.
- Schedule a time/day when upload speed should be lowered.
- Support for unlimited speeds in schedules (equivalent to turning off speed limits).
- Stream-based speed control: Set different upload speeds based on the number of active streams instead of bandwidth usage.
- Resilient startup: If a media server is temporarily unavailable, Speedrr retries with exponential backoff instead of crashing, and starts with safe defaults until the server is reachable.
Pull the image with:
docker pull itschasa/speedrrYour config file should be stored outside of the container, for easy editing.
You can then add a volume to the container (like /data/), which points to a folder where your config is stored.
Example docker run command:
docker run -d
-e SPEEDRR_CONFIG=/data/config.yaml
-v /folder_with_config/:/data/
--name speedrr
--network host
itschasa/speedrr
- Open your console and run the following command:
cd /boot/config/plugins/dockerMan/templates-user && touch my-speedrr.xml && nano my-speedrr.xml
- Go to speedrr-unraid.xml, and copy and paste it into your console.
- Press Ctrl+O, then Enter, then Ctrl+X (to save the file and exit).
- Open your WebUI >
Docker>Add Container. - Click
Select a template, and selectspeedrr. - The options should be fine as they are defaulted. Apply changes.
- Using the template, create config.yaml in your /appdata/speedrr/ folder, and fill out the config.
- Start/Restart the container in the WebUI.
- Check everything is working in the logs (Docker Logs).
- Download the source code.
- Install Python 3.10 (other versions should work).
- Install the required modules with
python -m pip install -r requirements.txt. - Edit the config to your liking.
- Run
python main.py --config_path config.yamlto start.
Instead of dynamically reducing upload speed based on bandwidth usage, you can configure speedrr to set specific upload speeds based on the number of active streams.
Traditional bandwidth-based control is reactive—it reduces your upload speed based on how much bandwidth streams are using. Stream-based control is predictive—you define exactly what upload speed you want for different numbers of streams.
Benefits:
- More predictable - You control exactly what happens with 1, 2, 3+ streams
- Max out when idle - Set unlimited upload when no streams are active
- Better balance - Fine-tune the trade-off between streaming quality and torrent upload
- Easier to configure - Just count streams instead of estimating bandwidth needs
Add stream_based_speeds to your media server configuration:
modules:
media_servers:
- type: plex
url: http://your-plex-server:32400
token: your_token
# ... other settings ...
stream_based_speeds:
enabled: true
speeds:
0: unlimited # No streams = unlimited upload
1: 10 # 1 stream = 10 Mbit/s upload
2: 8 # 2 streams = 8 Mbit/s upload
3: 6 # 3+ streams = 6 Mbit/s upload
default: 5 # Optional: fallback speedspeeds mapping - Define upload speeds for different stream counts:
- Numbers:
10,15,20(in your configured units) - Percentages:
"50%","80%"(of max_upload) - Unlimited:
unlimited(removes speed limit)
default (optional) - Fallback speed for undefined stream counts. If omitted, uses the highest defined count's speed.
- Stream Counting: Speedrr monitors your media server and counts active streams
- Filtering: Local streams, paused streams, and ignored IPs are excluded from the count
- Speed Selection: Upload speed is set based on your configured mapping
- Dynamic Updates: Speed adjusts automatically as streams start/stop
Scenario 1: Maximize seeding when idle
speeds:
0: unlimited # Full upload when not streaming
1: 8 # Conservative when streamingScenario 2: Granular control for multiple users
speeds:
0: unlimited
1: 12 # One user streaming
2: 10 # Two users
3: 8 # Three users
4: 6 # Four or more usersScenario 3: Using percentages
speeds:
0: "100%" # Full max_upload
1: "70%" # 70% of max_upload
2: "50%" # 50% of max_uploadSee config.stream_based.example.yaml for a fully documented configuration with detailed comments and multiple examples.
This feature is completely optional. Existing configurations without stream_based_speeds will continue to work with the traditional bandwidth-based speed control.
Anyone is welcome to contribute! Feel free to open pull requests.
Please report any bugs in the Issues section.
Got an idea for the project? Suggest it here!
