# Understand SQM and bufferbloat

**URL:** <https://forum.openwrt.org/t/understand-sqm-and-bufferbloat/88674>\
**Category:** Installing and Using OpenWrt\
**Created:** [February 15, 2021, 7:13pm UTC](https://forum.openwrt.org/t/understand-sqm-and-bufferbloat/88674 "2021-02-15T19:13:41Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![atrocia](https://forum.openwrt.org/letter_avatar/atrocia/32/5_5575768a8748004e209b776fc1b2916d.png) [@atrocia](https://forum.openwrt.org/u/atrocia)\
**Post date:** [February 15, 2021, 7:13pm UTC](https://forum.openwrt.org/t/understand-sqm-and-bufferbloat/88674/1 "2021-02-15T19:13:41Z")

</div>

Hi,  
I'm testing SQM on a TP-Link Archer C2600 with a FiOS connection to see if it improves my overall network performance. I'm testing using [http://www.dslreports.com/speedtest](http://www.dslreports.com/speedtest)  
Without SQM, my bufferbloat grades are mostly Bs with some Cs, and my quality grades are a mixture of As and Bs. With SQM (using standard settings, with cake / piece\_of\_cake, as recommended here: [https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm](https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm)), I still get a lot of bufferbloat Bs and Cs (perhaps even more Cs than before), but now the quality is pretty consistently A+  
Should I be taking these results seriously? Why is bufferbloat itself not improving - I thought that was the whole point of these SQM recommendations? I understand that if you don't have the CPU power for it, SQM won't work well, but I checked using top and idle never goes below 25%.  
I saw this: [SQM makes bufferbloat worse](https://forum.openwrt.org/t/sqm-makes-bufferbloat-worse/30555)  
Any guidance?

---

<div class="post-metadata">

**Author:** ![dlakelan](https://forum.openwrt.org/user_avatar/forum.openwrt.org/dlakelan/32/2320_2.png) [@dlakelan](https://forum.openwrt.org/u/dlakelan)\
**Post date:** [February 15, 2021, 7:48pm UTC](https://forum.openwrt.org/t/understand-sqm-and-bufferbloat/88674/2 "2021-02-15T19:48:12Z")

</div>

> [@atrocia](#):
>
> idle never goes below 25%.

I haven't looked at the specs on that device but is it a 2 cores 4 threads device? Perhaps 25% means "saturating one thread"?

NEVERMIND: I was thinking load, but you were saying idle... The device has 2 cores. so 25% idle could easily mean saturating one core and 50% saturating another core. Since SQM is single-threaded, if its core is saturated, it'd be unable to do a proper job.

Also you don't say anything about your speeds. Can you link to a speedtest result without and then with SQM?

---

<div class="post-metadata">

**Author:** ![mpa](https://forum.openwrt.org/letter_avatar/mpa/32/5_5575768a8748004e209b776fc1b2916d.png) [@mpa](https://forum.openwrt.org/u/mpa)\
**Post date:** [February 15, 2021, 8:22pm UTC](https://forum.openwrt.org/t/understand-sqm-and-bufferbloat/88674/3 "2021-02-15T20:22:39Z")

</div>

In addition, could you please show us your SQM configuration?

---

<div class="post-metadata">

**Author:** ![atrocia](https://forum.openwrt.org/letter_avatar/atrocia/32/5_5575768a8748004e209b776fc1b2916d.png) [@atrocia](https://forum.openwrt.org/u/atrocia)\
**Post date:** [February 16, 2021, 3:42am UTC](https://forum.openwrt.org/t/understand-sqm-and-bufferbloat/88674/4 "2021-02-16T03:42:46Z")

</div>

Okay, here are two fresh tests - I get a B for bufferbloat on both, but the quality goes from B to A+:

Without SQM: [http://www.dslreports.com/speedtest/67374092](http://www.dslreports.com/speedtest/67374092)  
With SQM: [http://www.dslreports.com/speedtest/67374121](http://www.dslreports.com/speedtest/67374121)

This is Verizon FiOS 100/100 (up to 110 each way in practice).

~# cat /etc/config/sqm

config queue 'eth1'  
option qdisc\_advanced '0'  
option interface 'eth0'  
option debug\_logging '0'  
option verbosity '5'  
option qdisc 'cake'  
option script 'piece\_of\_cake.qos'  
option linklayer 'ethernet'  
option overhead '44'  
option enabled '1'  
option download '90000'  
option upload '90000'

---

<div class="post-metadata">

**Author:** ![dlakelan](https://forum.openwrt.org/user_avatar/forum.openwrt.org/dlakelan/32/2320_2.png) [@dlakelan](https://forum.openwrt.org/u/dlakelan)\
**Post date:** [February 16, 2021, 3:55am UTC](https://forum.openwrt.org/t/understand-sqm-and-bufferbloat/88674/5 "2021-02-16T03:55:55Z")

</div>

Ignore the letter grades, the second one had substantially improved buffer management.

It does feel like you should be able to do a tad better though.

With SQM on during a speed test, if you watch `top -d 1` what does the idle percent do? And what does it do if you set the speed to 50Mbps

---

<div class="post-metadata">

**Author:** ![pythonic](https://forum.openwrt.org/letter_avatar/pythonic/32/5_5575768a8748004e209b776fc1b2916d.png) [@pythonic](https://forum.openwrt.org/u/pythonic)\
**Post date:** [February 16, 2021, 9:14am UTC](https://forum.openwrt.org/t/understand-sqm-and-bufferbloat/88674/6 "2021-02-16T09:14:43Z")

</div>

C2600 will have similar CPU frequency scaling issues to R7800 - suggest reading the [R7800 performance](https://forum.openwrt.org/t/r7800-performance/15780) thread, starting with using the performance governor and then try tuning ondemand governor settings. Without this, ~100Mb/s symmetrical will be pushing close to limits with SQM enabled.

---

<div class="post-metadata">

**Author:** ![moeller0](https://forum.openwrt.org/user_avatar/forum.openwrt.org/moeller0/32/1591_2.png) [@moeller0](https://forum.openwrt.org/u/moeller0)\
**Post date:** [February 16, 2021, 9:54am UTC](https://forum.openwrt.org/t/understand-sqm-and-bufferbloat/88674/7 "2021-02-16T09:54:21Z")

</div>

I concur with @dlakelan, Looking at the detailed bufferbloat figures (try clicking e.g. the link named 'Downloading' below the middle bar in the bufferbloat plot) SQM easily shaves of 100ms from tge Latency under load with a saturating download, from \> 150 to 35ms. The upload however does not seem to improve much... but there except for the spikes visible in both tests even without SQM the bufferbloat is not terrible.

---

<div class="post-metadata">

**Author:** ![atrocia](https://forum.openwrt.org/letter_avatar/atrocia/32/5_5575768a8748004e209b776fc1b2916d.png) [@atrocia](https://forum.openwrt.org/u/atrocia)\
**Post date:** [February 16, 2021, 1:18pm UTC](https://forum.openwrt.org/t/understand-sqm-and-bufferbloat/88674/8 "2021-02-16T13:18:07Z")

</div>

[Here's](http://www.dslreports.com/speedtest/67377758) the latest test.

Watching top, I see that idle drops to as low as 25%, and seems to bounce between 25-40% for the most intensive portions of the test. The grade is C here, and I'm not sure how to interpret the more detailed latency increase plots: they seem pretty low overall, with some really bad spikes?

[Here's](http://www.dslreports.com/speedtest/67377787) a test with speed set to 50000.

Idle never drops below 50% here, and it bounces between 50-70% for the more intensive portions.

I looked at the more detailed figures of the original tests, and I see the latency decrease there.

I looked at the R7800 thread, but it's a bit much for me - a whole spectrum of confusing and conflicting recommendations, over 2.5 years and considerable OpenWrt development. Is there any specific tweak from that thread that anyone would recommend?

I will very likely just drop SQM altogether - I'm not noticing much real world improvement, and as I discussed in [this thread](https://forum.openwrt.org/t/kernel-oops-with-tp-link-archer-c2600-on-18-06-2/31581/3), it seems to cause instability on my unit (perhaps due to the heavy CPU usage?) In fact, the router spontaneously restarted several hours ago, whereas before (re)enabling SQM, it used to stay up for at least weeks at a time.

Thank you everyone for your help. I'm happy to try further tweaks before giving up.

---

<div class="post-metadata">

**Author:** ![dlakelan](https://forum.openwrt.org/user_avatar/forum.openwrt.org/dlakelan/32/2320_2.png) [@dlakelan](https://forum.openwrt.org/u/dlakelan)\
**Post date:** [February 16, 2021, 3:53pm UTC](https://forum.openwrt.org/t/understand-sqm-and-bufferbloat/88674/9 "2021-02-16T15:53:02Z")

</div>

> [@atrocia](#):
>
> they seem pretty low overall, with some really bad spikes?

For sure a problematic graph. Everything is great except that last upload data point... That's really weird.

If you're seeing instability perhaps the cpu is throttling due to heat. Does this unit have a fan? I wonder if adding an external fan maybe by USB would improve things

---

<div class="post-metadata">

**Author:** ![atrocia](https://forum.openwrt.org/letter_avatar/atrocia/32/5_5575768a8748004e209b776fc1b2916d.png) [@atrocia](https://forum.openwrt.org/u/atrocia)\
**Post date:** [February 16, 2021, 4:00pm UTC](https://forum.openwrt.org/t/understand-sqm-and-bufferbloat/88674/10 "2021-02-16T16:00:14Z")

</div>

I don't think the unit has a fan. Perhaps I'll try one sometime - thanks. Something like [one of the AC-Infinity Multifans](https://www.amazon.com/dp/B00MWH4FL4/)? [from [this thread](https://www.reddit.com/r/HomeNetworking/comments/bwid2d/i_plan_on_putting_a_60mm_fan_to_my_router_can_the/)]

---

<div class="post-metadata">

**Author:** ![dlakelan](https://forum.openwrt.org/user_avatar/forum.openwrt.org/dlakelan/32/2320_2.png) [@dlakelan](https://forum.openwrt.org/u/dlakelan)\
**Post date:** [February 16, 2021, 4:02pm UTC](https://forum.openwrt.org/t/understand-sqm-and-bufferbloat/88674/11 "2021-02-16T16:02:44Z")

</div>

Yeah something like that should help with heat if that's the issue.
