SQM slows down Linksys WRT3200ACM

I have installed a new copy of OpenWrt and Luci today. I have BT Fibre 100 (fibre to the house). When I install SQM is slowing down the connection. I have tried both cake/piece_of_cake and fd-code/simple.qos and they both have the same effect.
A typical set of readings are:
without sqm ping 28 download 144.58 upload 29.2
with sqm ping 33 download 136.60 upload 28.63

Please does anybody have any ideas?

Thanks.
Chris.

SQM is supposed to cause some slowdown, to leave some bandwidth available, and be able to prioritize some traffic.

You can try to experiment with the configuration, to get the maximum bandwidth and retain the benefits of SQM.

Those are actually pretty decent compared to mine, on my wrt1200 with up/down on sqm set to 95% my speeds are cut about in half.

Did you set download and upload to 90..95% of your connection bandwidth?

Thanks for your responses.I have looked at this again.
Before applying SQM my speed test over three tests gave:
ping 25ms Download 143.05Mbps upload 29.00Mbps
ping 29ms Download 141.49Mbps upload 29.16Mbps
ping 32ms Download 146.26Mbps upload 29.13Mpps
Mean values: ping 28.67ms Download 143.6Mbps Upload 29.09

With Queus discpline: cake; Queue setup script: piece_of_cake over three tests
Ping 42ms Download 115.95Mbps upload 24.97Mbps
Ping 33ms Download 111.55Mbps upload 25.69Mbps
Ping 50ms Download 117.52Mbps upload 25.71Mbps
Mean values Ping 41.67ms (+45%) Download 115Mbps (-19.9%) upload 25.46Mbps (-12.48%)
So everything seems worse.

With Queus discpline: fq_codel; Queue setup script: simple over three tests
Ping 48ms Download 115.64Mbps upload 27.3Mbps
Ping 29ms Download 116.77Mbps upload 27.18Mbps
Ping 51ms Download 111.62Mbps upload 27.33Mbps
Mean values Ping 42.67ms (+48.8%) Download 114.68Mbps (-20.1%) upload 27.27Mbps (-6.26%)
So again everything worse. Cake slightly better with upload.

The finally to check nothing else has changed a three tests with SQM off again:
Ping 25ms Download 148.55Mbps upload 29.98Mbps
Ping 56ms Download 145.3Mbps upload 29.18Mbps
Ping 35ms Download 148.92Mbps upload 29.18Mbps
Mean values Ping 38.67ms Download 147.59Mbps upload 29.44Mbps

So do I conclude that it is best not to use SQM?

SQM is not going to improve your bandwidth, specially on synthetic tests. If all you care about are bulk downloads, then SQM is not for you.

SQM is going to improve latency, specially when mixing large and small downloads. Read about bufferbloat for info about the main advantage of SQM.

However, you still have not told us how you parametrized SQM...

Hi Eduperez,
Thanks. The only parameters I set were the dowload speed of 130Mbps and upload 27Mbps and on the link layer adaption tab per packet overhead 34. Are these OK?
Thanks,
Chris

Well that depends, but to quickly run the numbers, out of your set gross-shaper rates and the per packet overhead you can expect at best the following goodput (TCP/IPv4, MTU 1500):

130 * ((1500-20-20) / (1500+34)) = 123.728813559
27 * ((1500-20-20) / (1500+34)) = 25.6975228162

real world measurements tend to only approach but not to reach or exceed these values.

So your measured upload numbers for SQM seem a tad high* and the download numbers seem a tad low, the former might might be attributable to rounding and which time window a test actually evaluates (many speedtests, try to ignore the initial ramp-up phase of a connection, and that in turn with a bit of jitter can skew the measured rates). How did you perform these tests, by the way?

The strange part is the higher ping with SQM .
SQM should slightly decrease speed but it should lower ping during load (compared to full load without SQM).

You seem to experience higher ping with SQM, which makes me to think that you have something wrong.

1 Like

As I understand it, when the ping tests are done without any load on the connection (as most synthetic tests do), then SQM can only make things (a little bit) worse.

Without SQM, I would expect the ping times to get (much) worse under load; with SQM, ping times should not be affected by the load.

1 Like

This seems right in principle, so we need to figure out how these numbers were generated to try to understand what is happening here.

It would be good to see the output of:
cat /etc/config/sqm
tc -s qdisc
the result of a speedtest
tc -s qdisc
The idea here is to get a glimpse of cake's internal counters before and after a load to see whether cake notices the increased latency at all. And then we can take it from there...

cat /etc/config/sqm

config queue 'eth1'
	option qdisc_advanced '0'
	option debug_logging '0'
	option verbosity '5'
	option linklayer 'ethernet'
	option overhead '34'
	option interface 'pppoe-wan'
	option download '130000'
	option upload '27000'
	option enabled '1'
	option qdisc 'cake'
	option script 'piece_of_cake.qos'

tc -s qdisc

disc noqueue 0: dev lo root refcnt 2 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
qdisc mq 0: dev eth1 root 
 Sent 1085892675 bytes 5693159 pkt (dropped 0, overlimits 0 requeues 3155) 
 backlog 0b 0p requeues 3155
qdisc fq_codel 0: dev eth1 parent :8 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth1 parent :7 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth1 parent :6 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth1 parent :5 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth1 parent :4 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth1 parent :3 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth1 parent :2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth1 parent :1 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 1085892675 bytes 5693159 pkt (dropped 0, overlimits 0 requeues 3155) 
 backlog 0b 0p requeues 3155
  maxpacket 1514 drop_overlimit 0 new_flow_count 1661 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc mq 0: dev eth0 root 
 Sent 6796016365 bytes 7484717 pkt (dropped 0, overlimits 0 requeues 10598) 
 backlog 0b 0p requeues 10598
qdisc fq_codel 0: dev eth0 parent :8 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :7 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :6 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :5 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :4 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :3 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth0 parent :1 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 6796016365 bytes 7484717 pkt (dropped 0, overlimits 0 requeues 10598) 
 backlog 0b 0p requeues 10598
  maxpacket 1514 drop_overlimit 0 new_flow_count 6297 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 eth1.2 root refcnt 2 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
qdisc cake 8005: dev pppoe-wan root refcnt 2 bandwidth 27Mbit besteffort triple-isolate nonat nowash no-ack-filter split-gso rtt 100.0ms noatm overhead 34 
 Sent 2697667 bytes 23899 pkt (dropped 1, overlimits 17430 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 141504b of 4Mb
 capacity estimate: 27Mbit
 min/max network layer size:           28 /    1492
 min/max overhead-adjusted size:       62 /    1526
 average network hdr offset:            0

                  Tin 0
  thresh         27Mbit
  target          5.0ms
  interval      100.0ms
  pk_delay        204us
  av_delay         15us
  sp_delay          2us
  backlog            0b
  pkts            23900
  bytes         2699086
  way_inds           23
  way_miss          930
  way_cols            0
  drops               1
  marks               0
  ack_drop            0
  sp_flows            1
  bk_flows            1
  un_flows            0
  max_len          8461
  quantum           823

qdisc ingress ffff: dev pppoe-wan parent ffff:fff1 ---------------- 
 Sent 50016544 bytes 41036 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
qdisc mq 0: dev wlan1 root 
 Sent 8538000612 bytes 6007653 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev wlan1 parent :4 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 131981059 bytes 105082 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev wlan1 parent :3 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 8395580522 bytes 5888291 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 1506 drop_overlimit 0 new_flow_count 41 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev wlan1 parent :2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 10127330 bytes 13561 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev wlan1 parent :1 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 311701 bytes 719 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc mq 0: dev wlan0 root 
 Sent 11508393 bytes 77908 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev wlan0 parent :4 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 29309 bytes 65 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev wlan0 parent :3 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 11392752 bytes 77513 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev wlan0 parent :2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 69891 bytes 268 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev wlan0 parent :1 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 16441 bytes 62 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc mq 0: dev wlan2 root 
 Sent 83287071 bytes 149033 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev wlan2 parent :4 limit 10240p flows 1024 quantum 1614 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 64050 bytes 1000 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev wlan2 parent :3 limit 10240p flows 1024 quantum 1614 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 56424 bytes 330 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev wlan2 parent :2 limit 10240p flows 1024 quantum 1614 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 83032063 bytes 147469 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev wlan2 parent :1 limit 10240p flows 1024 quantum 1614 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
 Sent 134534 bytes 234 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
  maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc cake 8006: dev ifb4pppoe-wan root refcnt 2 bandwidth 130Mbit besteffort triple-isolate nonat wash no-ack-filter split-gso rtt 100.0ms noatm overhead 34 
 Sent 50010576 bytes 41032 pkt (dropped 4, overlimits 70364 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 561472b of 6500000b
 capacity estimate: 130Mbit
 min/max network layer size:           28 /    1492
 min/max overhead-adjusted size:       62 /    1526
 average network hdr offset:            0

                  Tin 0
  thresh        130Mbit
  target          5.0ms
  interval      100.0ms
  pk_delay        3.3ms
  av_delay        2.0ms
  sp_delay         11us
  backlog            0b
  pkts            41036
  bytes        50016544
  way_inds          232
  way_miss          938
  way_cols            0
  drops               4
  marks               0
  ack_drop            0
  sp_flows            1
  bk_flows            1
  un_flows            0
  max_len          1492
  quantum          1514

Okay, with these numbers the theoretical maxima are:
130 * ((1500 - 8 - 20 -20) / (1500 + 34)) = 123.05 Mbps
27 * ((1500 - 8 - 20 -20) / (1500 + 34)) = 25.55 Mbps
But that as expected does not change anything really important.

and these

indicate that cake has not seen noticeable internal delays. This is why now a speedtest result and the output of tc -s qdisc after that speedtest would be interesting to look at.

Please sandwich console output between lines only containing 3 backticks "`" each to get a fixed run length font that makes is easier to read code...

Thanks for your help. Please can I confirm that you want these outputs before and after a speedtest? I am using the BT Wholesale speedtest.
Thanks again,
Chris.

Yes, I want to compare what happens to cake's counters during the test, so the best is to compare the before and after outputs.

I would handle that with extreme care, I just ran a test from a well connected (gigabit ethernet) place, but " DOWNLOAD 1631.36 Mbps" or 1.6 Gbps seems a bit optimistic.

In short please use a better test, like fast.com (do an initial dummy test then click "settings" and changeParallel connections to Min: 16 / Max: 16; Test duration (seconds) to Min: 30 / Max: 30; and check the three checkboxes).