trickle enhancement: scheduled bandwidth shaping
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
trickle (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
Binary package hint: trickle
I have attached a patch that adds bandwidth scheduling to trickle. Schedules must be specified on the command line for now, but it would be a fairly easy change for them to be read from a file instead. Both -u and -d flags can be specified in the following form:
[default limit](:[days of week][start time],[end time],[bandwidth limit])+
default limit = the bandwidth limit (in kB) that is used when another limit is not specified
days of week = any of "Su" "M" "T" "W" "Th" "F" "Sa" in any order. If no day is specified, the schedule will apply for all days
start time = 3-or-4-digit 24-hour local time to begin the new bandwidth schedule. "1234" would mean 12:34 PM. "123" would mean 1:23 AM. "2345" would mean 11:45 PM.
end time = 3-or-4-digit 24-hour local time to end the new bandwidth schedule.
bandwidth limit = the bandwidth limit (in kB) that is used during the specified time.
Multiple schedules can be strung together on the command line. If hte schedules overlap, the last ones take precident.
Example: trickled -d 50 -u 10:WSaSu130,
This would start a trickled daemon that would enforce the following:
-constant 50 kB/s download limit
-1000 kB/s upload limit between 1:30 AM and 1:45 AM on Wednesdays, Saturdays, and Sundays
-96 kB/s upload limit between 12:00 noon and 3:00 PM on Mondays, Tuesdays, and Thursdays
-10 kB/s upload limit otherwise
Example: trickle -s -u 100 -d "10000:900,1700,10" -v wget www.example.
This would limit the bandwidth available to wget as follows:
-constant 100 kB/s upload limit
-10 kB/s download limit between 9:00 AM and 5:00 PM all days of the week
-10,000 kB/s download limit otherwise
I will attach 2 patches. The first, "trickle_
The second patch, "trickle_mydiff.gz" is the diff of my changes from the trickle-1.07-5 source that I obtained in Ubuntu 8.10 using the command "sudo apt-get source trickle". It is really the substance of my changes.
While I can't say that I've thoroughly tested my changes, they seem to work as intended. I used the modified version of trickle to bandwidth shape my remote backup. It was more restrictive during the evening (when I want my web browsing to be quick), and less restrictive during the night (sleeping) and in the middle of the day (at work). It worked exactly as I wanted it to.
P.S. I ran "sudo dpkg-buildpackage" to create the .deb that I installed to test my changes. dpkg thinks the version is 1.07-5, so the Update Manger is prompting me to "upgrade" to version 1.07-5 from the apt repositories. How do I create the package as something like version 1.07-5.1 to let my system know that this is the more up-to-date version?
Thanks in advance!