When someone downloads a file, watches video, or synchronizes large data, ping can rise sharply even though the connection is still fast. This is commonly called bufferbloat. On OpenWrt, SQM can control the queues and keep latency more stable.1
What does SQM solve?
SQM does not make an Internet plan faster. It schedules and regulates packets so the router does not keep too much data in its buffers. Latency-sensitive activities such as video calls, VoIP, and gaming are therefore less affected by background traffic.
SQM runs on the CPU. A low-end router may not keep up with a fast connection, so after enabling SQM, measure both throughput and CPU load instead of relying on theoretical speed.
Measure the connection before configuring
First measure download speed, upload speed, and idle latency. You can use the Waveform Bufferbloat test, Speedtest, LibreQoS, or an equivalent tool. Keep the network nearly idle and record the result for comparison after configuration.1
If OpenWrt is running as an access point, also check the upstream router. SQM on the access point cannot fix bufferbloat on the router acting as the gateway.
Install SQM
Install the LuCI package on OpenWrt:
| |
For command-line use only, install sqm-scripts instead of the LuCI interface. Package names and package managers may vary by OpenWrt version, so verify the firmware version first.
Configure with LuCI
Open Network → SQM QoS, then:
- In Basic Settings, enable Enable.
- Select the WAN interface connected to the Internet.
- Enter download and upload speeds at approximately 90% of the measured speed before SQM.
- Under Queue Discipline, select
cake. - Under Queue Setup Script, select
piece_of_cake.qos. - Select the link type under Link Layer Adaptation, then click Save & Apply.
The 90% value is only a starting point. If loaded latency is still high, gradually reduce the configured rate; if throughput falls too much, adjust it after measuring again.
Choose the correct overhead
The OpenWrt Wiki lists different reference values for different connection types. For Ethernet or fiber, start with Ethernet and an appropriate overhead. PPPoE usually needs a different overhead from plain Ethernet.
If you are unsure about the encapsulation or ISP parameters, do not copy a value from another connection. Incorrect overhead can reduce performance; measure before and after each change.
Disable hardware flow offloading
SQM is incompatible with hardware flow offloading, because offloading can bypass part of the kernel processing path. In LuCI, open Network → Firewall and disable hardware flow offloading when using SQM. Software flow offloading may still work according to the OpenWrt documentation, but test it on the specific device.1
On a multi-core router, Packet Steering (all CPUs) can be enabled in the global network options to distribute work more effectively. It is not a replacement for choosing the correct SQM rate.
Test after enabling SQM
Run the same bufferbloat test under conditions similar to the first test. The goal is not to retain 100% of download speed, but to reduce the extra latency added while the connection is loaded.
If throughput falls too much or the CPU stays heavily loaded:
- Lower the SQM rate or check the entered values.
- Verify the WAN interface.
- Try
fq_codelifcakeis too heavy for the router. - Review hardware flow offloading.
- Consider a stronger router if the connection is too fast for the CPU.
Conclusion
SQM is a practical way to improve the experience of a network with heavy background traffic. Measure first, start at about 90%, disable hardware flow offloading, and measure again. Every router and connection type has different limits, so do not copy someone else's values blindly.


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