Bookmark

Reducing bufferbloat on OpenWrt with SQM and CAKE

Bufferbloat occurs when a network device builds an oversized queue while the link is full. Latency rises even though download and upload speed still look high. OpenWrt SQM controls that queue by shaping traffic; it does not increase the line rate.

Measure first

Measure the connection while idle and during a loaded download/upload test. Record the real WAN rates rather than the advertised plan. SQM normally needs a value below the measured rate to leave headroom; 90% is only a starting point, not a universal setting.

Hardware flow offloading can bypass part of SQM. Disable it while testing, and only re-enable it after measurements prove that the result remains correct.

Install SQM

1
2
3
4
opkg update
opkg install luci-app-sqm
/etc/init.d/sqm enable
/etc/init.d/sqm start

Open Network > SQM QoS in LuCI and create the instance on the WAN/PPPoE interface carrying the real traffic. Do not attach it to the LAN bridge when the goal is to control the Internet queue.

Configure the important fields

  1. Select the active WAN interface.
  2. Enter Download and Upload rates below the initial measurements.
  3. Choose queue discipline cake.
  4. Start with the piece_of_cake.qos script.
  5. Select the correct link layer: Ethernet, DOCSIS, VDSL/ATM, or the type required by the ISP.
  6. Enter overhead only when the real encapsulation is known; a wrong value makes results worse.
  7. Disable hardware/software flow offloading during the evaluation.
  8. Click Save & Apply, then repeat the loaded test while another client creates traffic.

Tune and verify

Compare unloaded ping, download latency, upload latency, throughput, and router CPU before and after. If latency still rises, lower the rate or recheck the interface and link layer. If the CPU is saturated, SQM may not suit the line rate or the current model.

1
2
3
uci show sqm
/etc/init.d/sqm status
logread | grep -i sqm

Stop or disable the instance if throughput or CPU use is unacceptable:

1
2
/etc/init.d/sqm stop
/etc/init.d/sqm disable

SQM cannot fix noisy Wi-Fi, a faulty access line, or ISP throttling. Measure after every change and record the device, interface, rate, and link layer so the result can be reproduced.

Source


0 Bình luận

Góp Ý / Bình Luận / Đánh giá