Change throttle speed during backup (workaround)

In case anyone else misses this feature as much as I do, I thought I’d share my (Linux-specific) workaround.
I really need to limit upload speed during the day, but if I throttle to something daytime users can live with, my backups take over a month.

So I use the masochistic tc instead:

tc qdisc add dev eth0 root handle 1:0 htb default 99
tc class add dev eth0 parent 1:0 classid 1:1 htb rate 100Mbit ceil 100Mbit
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 1Mbit ceil 1Mbit prio 2
tc qdisc add dev eth0 parent 1:11 handle 10: sfq perturb 10
iptables -t mangle -A POSTROUTING -o enp3s0 -p tcp -d [target IP] -j CLASSIFY --set-class 1:11

And then a cron job sets the speed faster at midnight and slower at 8am:

tc class change dev eth0 parent 1:1 classid 1:11 htb rate [speed] ceil [speed] prio 2

Hope that helps someone.


Maybe the actual issue is bufferbloat?

I have duplicacy uploading full speed on 10mbit upstream, its’ literally straight line for few weeks now, and yet all WFH services are unaffected (the whole family in Zoom, Webex, etc).

Managing bandwidth is usually counterproductive, just as you touched on – doing so leaves a lot of bandwidth on the table. IMO – non-maxed out upstream == wasted money.

Maybe, but in my experience it’s a common occurrence on mediocre ADSL. Maxed out upload hinders ACKs for downloads, so the whole connection is bogged.

I never had any issues back when I had a nice 10/100 link (i miss those days), but always had this in all the dinky ADSLs I’ve been forced to live with since then.

I guess non-crappy routers/ISPs could prioritize ACKs but my only solution has always just been to limit uploads and ensure I leave a chunk of upstream available for the rest of the devices on my network.

1 Like

This is the very definition of bufferbloat: ack packets sit in the queue until the enormous buffers full of bulk traffic drain. And yes, it is very common, and yea, virtually none of consumer gateways have means to address that.

Try the gateway that supports SQM. You may even be able to boot OpenWRT on your existing “crappy” router, or if not — get a cheap linksys from eBay, install OpenWRT, configure SQM and add it behind your gateway.

SQM will fix your issues completely without the need to manage (and waste) the bandwidth manually.

Related topics

1 Like