OpenWrt SQM settings: CAKE setup that actually works
SQM with the cake queue discipline is the standard fix for bufferbloat on OpenWrt — but between sqm-scripts, bandwidth entry and queue presets, it is easy to configure it in a way that quietly does nothing. This guide covers every setting that matters, which CAKE preset to pick, and the numbers we measured on a real box. As of 2026-11.
What SQM actually does
When a line saturates, the router fills its send buffer and every packet queues behind a bulk download — that is bufferbloat. SQM applies CAKE (Common Applications Kept Enhanced, the successor to fq_codel) and paces the link to your measured bandwidth, keeping the queue near-empty. A background download stops stalling your game or call. The OpenWrt wiki calls this the "smart queue management" layer; in practice it is two settings done right.
The SQM settings that matter
| Setting (LuCI → Network → SQM QoS) | What to enter | Why |
|---|---|---|
| Enable | Checked | SQM off = no shaping at all |
| Interface name | Your WAN (eth0, pppoe-wan, wan) | Shaping must sit on the bottleneck interface, not the LAN bridge |
| Download speed (kbit/s) | Measured down × 0.85–0.90 | Headroom for ATM/DOCSIS/Ethernet overhead; plan speed always overshoots reality |
| Upload speed (kbit/s) | Measured up × 0.85–0.90 | The single most important field — uploads are what trigger bufferbloat in calls and games |
| Queue discipline | cake | AQM that keeps queues short; avoid legacy htb-based choices for latency work |
| Queue setup script | piece_of_cake (start here) | Preset wiring for the common case; see below |
| Sqm verbosity / debug logging | Off (default) | No functional effect, only log noise |
How to get the measured numbers: run a plain speed test three times at a quiet hour (late night), take the median, then knock off 10–15%. Enter the result in kbit/s (Mbit/s × 1000). If you change ISPs or plans, re-measure — old values silently mis-shape the new line.
CAKE QoS presets: piece_of_cake vs diffserv4 vs besteffort
The "queue setup script" dropdown wires CAKE with a preset. For most homes this is the only choice you need to think about:
- piece_of_cake (default) — CAKE with diffserv0, compensates for common overheads, best latency-per-throughput trade for mixed home traffic. If unsure, stop here.
- diffserv4 — honours DSCP priority marks into four tiers (bulk / best effort / video / voice). Worth it for VoIP-heavy homes and small offices; costs slightly more CPU per packet.
- besteffort — single tier, no DSCP handling. Use on very weak CPUs to save cycles, or to test whether DSCP marks from some device are misbehaving.
Both cake qos keywords you will see in forum configs (qos layer, diffserv)
map to these presets — there is no separate "cake qos" package to install.
Measured: before vs after (full numbers)
Test bench: NanoPi R5C (4× Cortex-A55) · 1000M↓/50M↑ DSL. 16-thread saturated download 30 s × 2, concurrent ping, 2-run mean.
| Metric | OFF (baseline) | NetSteer ON | Change |
|---|---|---|---|
| Avg full-load latency | 58.6 ms | 7.8 ms | ↓ 87% |
| Full-load spread (p99−p50) | 56.4 ms | 6.9 ms | ↓ 88% |
| Idle latency | 5.79 ms | 5.91 ms | ≈ flat |
| Full-load throughput | 823 Mbps | 581 Mbps | −29%* |
* trade-off: enabling cake costs ~29% peak throughput (4-core soft-forward shaping overhead) in exchange for deterministic full-load latency; both still far above typical daily use. These are the settings above, applied by NetSteer automatically — the manual LuCI path reaches the same numbers.
Two routes to a lag-free line
| Route | What you need | Good when |
|---|---|---|
| A. Software only — SQM on your existing OpenWrt box | Any OpenWrt router with enough CPU for cake at your line speed | Line ≤ ~300–500 Mbit/s on a typical MT7621-class router, or you already run a soft router |
| B. SQM-capable hardware — upgrade the router | Stronger CPU (Quad-A53/A55, x86 N100), see our best OpenWrt routers for SQM | Gigabit+ plans, many concurrent streams, or CAKE pins the CPU at 100% |
Quick check for route A vs B: enable SQM, run the bufferbloat test again, and watch
CPU load (top). If latency is fixed and CPU sits under ~70%, stay. If CAKE maxes a core and
throughput craters, move to B.
How NetSteer automates all of this
NetSteer's one-key health check detects the missing packages (sqm-scripts + cake), picks the preset for your detected bandwidth, and writes the same settings above. You get a real A/B read — it measures a switch-off baseline first, then shows the actual gain on your box. No fixed promises: if your line is already well-provisioned it reports "flat", and that is honest.
Read the RPS / IRQ all-core receive section too — on x86 soft routers the second half of the win is spreading packet processing across cores. NAT problems? See fullcone NAT.
FAQ: OpenWrt SQM settings
What is SQM on OpenWrt?
SQM (Smart Queue Management) is the OpenWrt package that applies a queue discipline — cake is the standard choice — to your WAN link. It paces traffic to your real bandwidth so the router queue stays near-empty, which removes bufferbloat. It needs the sqm-scripts package plus the cake kernel module.
What speed should I enter in the SQM settings?
Your measured bandwidth, not the advertised plan speed. If a quiet-hour test shows 912 Mbit/s down / 47 Mbit/s up on a 1000/50 plan, enter roughly 85-90% of that (about 800/42) to leave headroom for ATM/DOCSIS overhead. Over-provisioning is the number one reason SQM appears to do nothing.
Which CAKE preset should I use for gaming?
Start with piece_of_cake (the default, Diffserv0): it is tuned for typical home traffic and gives the best latency-per-throughput trade. If you run VoIP or want per-flow priority tiers, switch to diffserv4 — it honours DSCP marks but costs a little more CPU. Besteffort disables tiering entirely; for a pure gaming box, piece_of_cake is usually the right answer.
Is there a downside to enabling SQM?
Yes — CAKE trades peak throughput for latency. On our 4-core NanoPi R5C bench, saturated throughput dropped about 29% while full-load latency fell 87%. On gigabit+ lines an SQM-capable router (or a soft router with a multi-gigabit NIC) keeps the absolute loss small.