Skip to content

SQM and CAKE on OpenWrt: low latency when the line is full

Keeps latency low under load. Start at 90% of measured speed.

SQM (Smart Queue Management) shapes traffic slightly below your line rate, so the queue forms in the router, where it can be managed, instead of in the modem. Used with the CAKE queueing discipline, it keeps latency low while the line is busy. That problem is known as bufferbloat.

  1. Install luci-app-sqm, or sqm-scripts if you don’t use LuCI.
  2. Measure your real download and upload speed, then set both to 90% of what you measured.
  3. Choose cake with piece_of_cake.qos.
  4. Test again under load and adjust. fq_codel with simple.qos is the lighter, less complete alternative.

CAKE has been in the Linux kernel since 4.19.

After installing SQM:

Terminal window
cat /etc/config/sqm
  • Shaping uses CPU. On a fast line a small router may not keep up, so compare speed and latency before and after.
  • Set the rates from a measurement, not from your plan’s advertised speed.

Sources

Router.Homes

Independent OpenWrt notes. Every page states the firmware, device, package manager and way back.

Icons: Solar by 480 Design, CC BY 4.0