Wirebook

Wirebook › Bonus lesson

Why does the game lag when someone starts a download?

Bonus lesson · about 9 minutes · hands-on · nothing you type leaves your browser

You're winning a game, and then someone in the house starts downloading a film. Suddenly your character jumps around and your shots land late, even though your internet is "fast". Why? Because your internet line works like a shop with one checkout, and a download is a shopper with endless trolleys.

The one-checkout shop

Your game sends a tiny basket 🧃 to the checkout 50 times a second. The brown bar is the queue of download trolleys waiting in your router. Start the shop, switch the download on, then try a smaller queue or open a quick lane. Watch the game's ping: the time a basket takes to get through.

How much queue space the router keeps
Game ping–
Download speednothing downloading
Game parcelsnone lost

under 50 ms: smooth up to 120 ms: laggy over 120 ms: unplayable

What's really going on

AHA! The fix isn't a faster internet plan. It's a smarter queue: keep the line short, and let small baskets go first. The download hardly slows down at all.

Be the shop manager: one busy evening

Smart queues have one catch: they only work if the queue builds up in your router, not in the provider's box, which has a huge plain queue and no quick lane. So you set a speed limit just under the line's real speed. But the real speed wobbles from night to night. Pick a limit, run the evening (a download starts, then a game update joins in), and see if the game stays smooth.

(pick a limit and run the evening)

The trolley in a juice-box costume

If small baskets get to go first, what stops a download from just saying it's a small basket? Real parcels can carry a label asking for the quick lane. Add a video call (a shopper carrying a birthday cake: it can't wait either), then dress the download up in a quick-lane costume 🥸 and see which kind of shop gets fooled.

How the shop decides who goes first
Game ping–
Video callno call
Download speed–

Why routers don't just trust the label

So how do you fix it at home?

Look in your router's settings for something called SQM, Smart Queue, Adaptive QoS, fq_codel or CAKE. Turn it on and set the download and upload limits to about 90% of the speed a speed test really measures. You give up a sliver of top speed and get a game that stays smooth while everyone else downloads. If your router has no such setting, the quick wins are to pause cloud photo backups while you play and to schedule big game updates for the middle of the night. To check, run a speed test that shows ping while downloading (sometimes called loaded latency): if it jumps by a lot, you've got bufferbloat.

Lag has a home-made half too, before anything leaves the house: the controller, the game's frames and the TV. Climb the lag ladder from thumb to TV. And past your front door, the pipe is shared with the whole street: see why the internet slows down in the evening.

Grown-up twin: Tooltern's help pages on fixing lag when someone downloads, what a good ping, jitter and packet loss look like and the Mbps to MB/s converter show the same ideas on a real network.

Words from this lesson

Earn a bonus badge

Get all 5 right to collect the Checkout queue bonus badge. Bonus badges are extra: they don't change your stamp count or rank. Wrong answers are fine: just try again.

1. Your game lags only when someone else in the house is downloading. What is the most likely cause?

2. Why does a download fill the queue right up?

3. What does a smart queue (SQM, fq_codel or CAKE) do?

4. Why do people set the smart queue's speed limit a little below their real internet speed?

5. A download labels its parcels as “quick lane, please”. Why doesn't a smart queue like fq_codel let it jump ahead?

Try another lesson

  1. 3Can a website get tired?7 min · interactive
  2. 12How does a game remember where you got to?6 min · interactive
  3. 1What happens when you open a web page?6 min · interactive