Skip to content

Fix bufferbloat on OpenWrt routers

Updated 2026-11-12

Real Smart Queue

Yes. OpenWrt has real Smart Queue with CAKE, the best fix for bufferbloat on a home router.

The sqm-scripts package shapes your line to just under its real speed and uses CAKE (or fq_codel) so small game and call packets don't wait behind downloads.

1. Test before you change anything

Run the Lag Check and note the "Lag under load" grade and your download and upload speeds. You'll compare against it afterwards.

2. Where the setting is

In the web interface (LuCI)

  1. Go to System โ†’ Software, update the lists and install luci-app-sqm.
  2. Reload the page and open Network โ†’ SQM QoS.
  3. On Basic Settings, tick Enable this SQM instance, pick your WAN interface (often wan or the modem's port) and enter your download and upload speeds in kbit/s.
  4. On Queue Discipline, choose cake with piece_of_cake.qos.
  5. On Link Layer Adaptation, pick your line type (for DSL, choose ATM or Ethernet with the overhead your line uses; for cable or fibre leave it as the default or set Ethernet with overhead 44 if you know it).
  6. Save & Apply, then test again.

Or from the command line

  1. Log in over SSH and install the package. Then set the speeds in LuCI as above.

Install Smart Queue on OpenWrt

opkg update && opkg install luci-app-sqm

Newer OpenWrt releases that use apk instead of opkg: apk update && apk add luci-app-sqm.

3. The numbers to enter

OpenWrt asks for kbit/s, so 100 Mbps is 100000. Start at about 90% of your measured speed; the Smart Queue assistant works out the exact figures from your Lag Check. Our helper can also try 90%, 85% and 80% for you and keep the first one that works.

Work out my limits

The assistant starts at 90% of your measured speed and tells you when to drop to 85% or 80%.

Gotchas

  • Hardware NAT or flow offloading sends traffic around the router's CPU, and with it around Smart Queue. If your grade doesn't improve, look for an acceleration or offloading setting and turn it off. On OpenWrt it's under Network โ†’ Firewall โ†’ Routing/NAT Offloading; hardware flow offloading bypasses SQM on many routers, so leave it off.
  • Smart Queue runs on the router's CPU. Cheap routers often top out somewhere around 300 to 500 Mbps with it on; above that the shaped speed drops well below your limit. On fast plans that can be worth it for lag, or a sign you need stronger hardware.
  • Pick the interface that faces the internet. Shaping a LAN port or a bridge shapes the wrong direction.

Questions

How do I install SQM on OpenWrt?

In LuCI, go to System โ†’ Software, update the lists and install luci-app-sqm, then open Network โ†’ SQM QoS. From SSH, run opkg update && opkg install luci-app-sqm, or apk update && apk add luci-app-sqm on releases that use apk.

Should I use CAKE or fq_codel on OpenWrt?

CAKE with piece_of_cake.qos where the router can run it: it needs the least tuning. fq_codel with simple.qos uses less CPU and is the fallback on slower routers that can't keep up with CAKE at your line speed.

What download and upload values should I enter in SQM?

About 90% of your measured speeds, in kbit/s (100 Mbps is 100000). Test again after Save & Apply; if lag under load is still graded B or worse, lower both to 85%, then 80%.

Why didn't SQM fix my bufferbloat on OpenWrt?

The usual reasons are flow offloading switched on (it sends traffic around SQM), SQM set on a LAN interface instead of the WAN, limits above the line's real speed, or a router CPU that can't shape your speed. Check them in that order.

Does running a VPN on OpenWrt add lag?

It can. The router's CPU has to encrypt every packet for the whole household as well as run SQM, so on smaller routers both the shaped speed and ping can suffer. A VPN rarely lowers game ping in the first place; the article on VPNs and ping explains the one case it does.

Related guides

Test after the change. A good setup brings lag under load down to A or B.

Test before and after