[Solved] SQM decreases speeds by 20Mbps/33%

Summary: turning on SQM decreases my 60Mbps down to a max of 40Mbps down. Is this a firmware/settings issue, or am I being limited by my device? (Archer C7 v5)

Details:

  • CenturyLink 60Mbps down, 5Mbps up DSL
  • Zyxel C300A DSL modem/router/AP combo in transparent bridging mode
  • Archer C7 v5 as the router and AP
  • OpenWRT 21.02.0
  • Installed the sqm-scripts and luci-app-sqm packages
  • Installed adblock and luci-app-adblock
  • WAN set up as PPPoE, no changes to WAN6

SQM settings/changes:

  • Interface name: pppoe-wan [have also tried on 'switch vlan: "eth0.2" (wan, wan6)' with similar results]
  • Down speed: 55000
  • Up speed: 4500
  • Link layer: ATM [not positive if I have ADSL(2) or VDSL]
  • Per packet overhead: 44

I have also started having issues where if one device is downloading at near the max bandwidth, no other devices will be able to load anything. This seems to be exactly opposite of the purpose of SQM, despite the DSLReports speed test showing vast improvements in bufferbloat.

What am I missing, or what do I need to check? I don't know where to even start troubleshooting this. It seemed like it worked wonderfully for a short time, even with the lower download speeds, but then started having other issues. I reset the firmware settings even and started from scratch with the same packages, with the same results. Should I completely reflash and see if I can get the good results again?

Thanks in advance!

Nope, ADSL tops out at about 25/5 Mbps, in theory one can use ATM/AAL5 encapsulation also with VDSL2, but I have never seen this in the wild, so I would assume PTM (which means in SQM speak "Ethernet with overhead").

That is a bit on the high side for VDSL2, but typically it only costs little bandwidth and helps against bufferbloat to (slightly) overestime the per-packet-overhead.

But let's calculate the theoretical goodput (what you would measure in an on-line speedtest) for you SQM settings (for PPPoE/IPv4/TCP with MTU 1500, and per-packet-overhead 44):

55.0 * ((1500-8-20-20)/( ceil((1500+44)/48) * 53 )) = 45.66 Mbps
4.5 * ((1500-8-20-20)/( ceil((1500+44)/48) * 53 )) = 3.74 Mbps

with a more likely setting of ethernet with overhead, and per-packet-overhead of 34 on pppoe-wan bytes you could expect:

55.0 * ((1500-8-20-20)/(1500-8+34 )) = 52.33 Mbps
4.5 * ((1500-8-20-20)/(1500-8+34)) = 4.28Mbps

This looks a bit like something is off here.

Are all devices using cables to connect to the router or are you using WiFi by chance?

could you please post the output of the following commands:

  1. cat /etc/config/sqm
  2. tc -s qdisc

Let's first try to do some "diagnostics" while the router is in this weird state, please.

1 Like

Thank you for the help.

Should I change my link layer settings first before other diagnostics? Results below are leaving as is for both.

Some of those devices are on WiFi, yes, but I've also had issues with attempting to browse the web from the computer that is on ethernet and doing the high bandwidth downloading. I can test this more if there are other issues that are apparent, since I know WiFi is prone to interference, etc.

  1. cat /etc/config/sqm:
config queue 'eth1'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'
        option enabled '1'
        option debug_logging '0'
        option verbosity '5'
        option linklayer 'atm'
        option overhead '44'
        option download '55000'
        option upload '4500'
        option interface 'pppoe-wan'
  1. tc -s qdisc
qdisc noqueue 0: dev lo root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 9475337250 bytes 12011850 pkt (dropped 0, overlimits 0 requeues 14)
 backlog 0b 0p requeues 14
  maxpacket 1514 drop_overlimit 0 new_flow_count 26 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc noqueue 0: dev br-lan root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth0.1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth0.2 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 8019: dev pppoe-wan root refcnt 2 bandwidth 4500Kbit besteffort triple-isolate nonat nowash no-ack-filter split-gso rtt 100ms atm overhead 44
 Sent 752340212 bytes 5220097 pkt (dropped 9198, overlimits 5886787 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 1058Kb of 4Mb
 capacity estimate: 4500Kbit
 min/max network layer size:           25 /    1492
 min/max overhead-adjusted size:      106 /    1696
 average network hdr offset:            0

                  Tin 0
  thresh       4500Kbit
  target            5ms
  interval        100ms
  pk_delay       2.75ms
  av_delay        787us
  sp_delay         21us
  backlog            0b
  pkts          5229295
  bytes       765111571
  way_inds       770511
  way_miss        68798
  way_cols            0
  drops            9198
  marks               0
  ack_drop            0
  sp_flows            1
  bk_flows            1
  un_flows            0
  max_len         22050
  quantum           300

qdisc ingress ffff: dev pppoe-wan parent ffff:fff1 ----------------
 Sent 11437846083 bytes 9128206 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev wlan0 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev wlan1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 801a: dev ifb4pppoe-wan root refcnt 2 bandwidth 55Mbit besteffort triple-isolate nonat wash no-ack-filter split-gso rtt 100ms atm overhead 44
 Sent 11433868290 bytes 9125458 pkt (dropped 2748, overlimits 12565325 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 772Kb of 4Mb
 capacity estimate: 55Mbit
 min/max network layer size:           25 /    1492
 min/max overhead-adjusted size:      106 /    1696
 average network hdr offset:            0

                  Tin 0
  thresh         55Mbit
  target            5ms
  interval        100ms
  pk_delay        143us
  av_delay         32us
  sp_delay         13us
  backlog            0b
  pkts          9128206
  bytes     11437846083
  way_inds      1386087
  way_miss        65383
  way_cols            0
  drops            2748
  marks               0
  ack_drop            0
  sp_flows            1
  bk_flows            1
  un_flows            0
  max_len          1492
  quantum          1514

For diagnostics of the status quo, keeping them unchanged seems decent, if however you see this as an exercise in optimizing the settings, I would repeat the tests with the changes settings.

I would always try to first test with wired machines, as WiFi has its own collection of challengen that can easily distract when optimizing/debugging SQM. But then I would always include WiFi tests, after getting the non-WiFi access into acceptable state.

This is missing out on a number of nifty tricks cake brings to the table, like per internal IP fairness (which often is not exactly what people want, but overall pretty decent and for a number of users simply "good enough", btw, the whole linked page is worth reading when optimising SQM is desired).

These look unsuspicious, so nothing for me to comment upon.

1 Like

I updated the link layer settings and raised the shaping speed limits to what my actual speeds are supposed to be. That has gotten me to the calculated goodput values you provided for packet overhead set to 34.

Perhaps all I'm seeing is variation in the network outside of my control. Or perhaps I just need to tune SQM a bit more. I'll definitely read through the SQM details and see if anything there makes a difference.

Thank you for your help!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.