The complaint, delivered with feeling, was that "the internet is broken" every evening at around eight. It was not broken. It was that four people in one house had all decided eight o'clock was the time to stream something, push a backup to the cloud, and update a games console, and the poor little uplink was trying to do all of it at once. The download was fine. It was the upload quietly filling, and once an upload buffer is full everything interactive falls apart.
That is the thing nobody tells you about a fast home connection. You can have plenty of download headroom and still have a miserable time, because a single fat upload saturates the link, packets queue up waiting their turn, and your latency goes from 15ms to 400ms. Video calls stutter. Web pages hang. Everyone blames the wifi.
measure first, fiddle later
Before touching any QoS settings I wanted numbers, because tuning a link you haven't measured is just guessing with extra steps. The tool for this is flent or, if you want it quick and dirty, just run a speed test whilst pinging your gateway and watch what happens to the ping.
ping -i 0.2 192.168.1.1 &
# now start a big upload and watch the round-trip times climb
Mine went from a steady 12ms idle to north of 300ms under upload load. Classic bufferbloat. The buffers in the path are too big and too dumb; they hoard packets rather than dropping a few early to signal "slow down". That is the whole problem in one sentence.
the fix
The router runs LEDE, so I had tc and the smart queue management bits available. SQM with the cake qdisc is the modern answer and it is genuinely good. The trick is not to let your line run flat out. You set the shaper to just under your real sync rate, maybe 90 to 95 percent, so the queue lives on your router where you control it rather than in the ISP's kit where you don't.
# rough shape: set these to ~90% of measured throughput
DOWNLINK=58000 # kbit
UPLINK=9000 # kbit
# cake handles per-flow fairness and ack prioritisation for you
The key settings:
- Set the shaped rate a touch below your actual line speed so the bottleneck sits on your box.
- Let
cakedo per-flow fairness so one big transfer can't starve everything else. - Don't bother hand-classifying traffic by port; the flow-fairness approach beats manual rules in nearly every real household, and it is far less effort to maintain.
I deliberately did not build an elaborate priority scheme tagging video calls as gold and downloads as bronze. I tried that years ago and spent more time maintaining the classifier than I ever saved. Fair queuing gets you ninety percent of the benefit with none of the fuss.
the result
Idle ping unchanged. Ping under full upload load: about 25ms, up from 12, which is the small price cake charges for keeping the queue short. The big transfers run a hair slower because I gave up that top five percent of throughput. Nobody has ever once noticed the slower download. Everybody noticed that the calls stopped breaking up.
The phrase "the internet is broken at eight o'clock" has not been uttered since, which on a home network counts as a complete and total victory.