Repository navigation
Priority system
#1529
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
For a 5-tier priority system in a download manager, there is no single rigid rule, but the gold standard is dynamic proportional bandwidth allocation.
The core principle is: priority should guarantee a share of speed only when downloads compete. If only one file is downloading (even with the lowest priority), it should be able to utilize 100% of the available bandwidth.
Here are the two best approaches for configuring percentage limits (weights) when files from all five categories are downloading simultaneously:
Option 1: Balanced (Recommended)
This option smoothly distributes bandwidth, ensuring that lower priorities do not completely "starve" while giving a clear advantage to critical files.
• 🔴 Maximum: 40% (quickly downloads the most critical files)
• 🟠 High: 25%
• 🟢 Normal: 17% (the standard baseline weight)
• 🔵 Low: 12%
• ⚪ Lowest: 6% (background downloads that can wait)
Option 2: Aggressive (Top-Priority Focused)
Best suited if the maximum priority means "download right now at all costs," while other files can practically grind to a halt.
• 🔴 Maximum: 50%
• 🟠 High: 25%
• 🟢 Normal: 15%
• 🔵 Low: 7%
• ⚪ Lowest: 3%
Implementation Logic (The Token/Share Algorithm)
Instead of hard-limiting the speed (e.g., strictly restricting a connection to 40% of the network card capacity), it is best to use a system of relative weights (shares or tokens).
Example: If only one "Normal" file (weight 3) and one "Low" file (weight 2) are downloading, the sum of active weights is 5. The "Normal" file gets 3/5 (60%) of the speed, and the "Low" file gets 2/5 (40%). As soon as they finish and only a "Lowest" priority file remains, it will automatically scale up to receive 100% of the bandwidth.
All reactions