[Bug 364986] [NEW] trickle enhancement: scheduled bandwidth shaping

mblythester mblythester at gmail.com
Wed Apr 22 06:05:42 UTC 2009


Public bug reported:

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,145,1000:MTTh1200,300,96
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.net/bigfile.tar.gz
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_1.07-5.diff.gz" appears to
be the total diff between a vanilla source tree of trickle-1.07 and my
current version (including my changes and Ubuntu's customization?).

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.

** Affects: trickle (Ubuntu)
     Importance: Undecided
         Status: New

-- 
trickle enhancement: scheduled bandwidth shaping
https://bugs.launchpad.net/bugs/364986
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs




More information about the universe-bugs mailing list