Default qdisc is not fq_codel on OpenWrt 22.03.3

I have installed OpenWrt 22.03.3 on Mikrotik RB750Gr3. But default qdisc for devices is not fq_codel. tc qdisc show command output is :

root@RB750Gr3:~# tc qdisc show
qdisc noqueue 0: dev lo root refcnt 2 
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
qdisc noqueue 0: dev wan root refcnt 2 
qdisc noqueue 0: dev lan2 root refcnt 2 
qdisc noqueue 0: dev lan3 root refcnt 2 
qdisc noqueue 0: dev lan4 root refcnt 2 
qdisc noqueue 0: dev lan5 root refcnt 2 
qdisc noqueue 0: dev br-lan root refcnt 2

Shouldn't it is fq_codel instead of noqueue.

1 Like

SQM needs to be on the chokepoint which is your WAN, which should be your eth0

1 Like

I am confused with your comment. Should I select eth0 for SQM interface. I want to give about how I had configured SQM-cake with details.

I had set SQM interface to wan. I have 50Mbps/5Mbps cable (Docsis 3.0) plan and I get 48.8Mbps/4,85Mbps upload from iperf test without SQM.

SQM configuration is:

root@RB750Gr3:~# cat /etc/config/sqm 

config queue 'eth1'
    option qdisc 'cake'
    option script 'piece_of_cake.qos'
    option interface 'wan'
    option debug_logging '0'
    option verbosity '5'
    option qdisc_advanced '1'
    option ingress_ecn 'ECN'
    option egress_ecn 'NOECN'
    option linklayer 'ethernet'
    option overhead '22'
    option linklayer_advanced '1'
    option tcMTU '2047'
    option tcTSIZE '128'
    option tcMPU '64'
    option linklayer_adaptation_mechanism 'default'
    option qdisc_really_really_advanced '1'
    option iqdisc_opts 'nat dual-dsthost'
    option eqdisc_opts 'nat dual-srchost ack-filter'
    option upload '4320'
    option squash_dscp '0'
    option download '40000'
    option squash_ingress '1'
    option enabled '1'

Some times web page loading had stuck or waiting for a long time. After searching forum, I had found @moeller0's advice on this post. There was large packets on wan and ifb4wan interfaces ( max_len on Cake statistics) too. I had installed ethtool and run theese commands.

ethtool -K wan tso off gso off gro off
ethtool -K lan2 tso off gso off gro off
ethtool -K lan3 tso off gso off gro off
ethtool -K lan4 tso off gso off gro off
ethtool -K lan5 tso off gso off gro off

After some iperf test which run for upload and download same time, I got these results.

root@RB750Gr3:~# tc -s qdisc show dev wan
qdisc cake 8005: root refcnt 2 bandwidth 4320Kbit besteffort dual-srchost nat nowash ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 118261315 bytes 898179 pkt (dropped 96706, overlimits 572255 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 251424b of 4Mb
 capacity estimate: 4320Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       64 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh       4320Kbit
  target            5ms
  interval        100ms
  pk_delay       1.19ms
  av_delay        188us
  sp_delay         18us
  backlog            0b
  pkts           994885
  bytes       126404190
  way_inds         3495
  way_miss        13225
  way_cols            0
  drops             259
  marks               0
  ack_drop        96447
  sp_flows            1
  bk_flows            1
  un_flows            0
  max_len          1514
  quantum           300

qdisc ingress ffff: parent ffff:fff1 ---------------- 
 Sent 1778232547 bytes 1378731 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0

 root@RB750Gr3:~# tc -s qdisc show dev ifb4wan
qdisc cake 8006: root refcnt 2 bandwidth 40Mbit besteffort dual-dsthost nat nowash no-ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 1786967097 bytes 1371699 pkt (dropped 7039, overlimits 1068899 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 1073088b of 4Mb
 capacity estimate: 40Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       68 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh         40Mbit
  target            5ms
  interval        100ms
  pk_delay       6.61ms
  av_delay        4.1ms
  sp_delay         16us
  backlog            0b
  pkts          1378738
  bytes      1797535372
  way_inds        11860
  way_miss        11770
  way_cols            0
  drops            7039
  marks               5
  ack_drop            0
  sp_flows            2
  bk_flows            1
  un_flows            0
  max_len          1514
  quantum          1220

After activate SQM on wan :

root@RB750Gr3:~# tc qdisc show
qdisc noqueue 0: dev lo root refcnt 2 
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64 
qdisc cake 8005: dev wan root refcnt 2 bandwidth 4320Kbit besteffort dual-srchost nat nowash ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
qdisc ingress ffff: dev wan parent ffff:fff1 ---------------- 
qdisc noqueue 0: dev lan2 root refcnt 2 
qdisc noqueue 0: dev lan3 root refcnt 2 
qdisc noqueue 0: dev lan4 root refcnt 2 
qdisc noqueue 0: dev lan5 root refcnt 2 
qdisc noqueue 0: dev br-lan root refcnt 2 
qdisc cake 8006: dev ifb4wan root refcnt 2 bandwidth 40Mbit besteffort dual-dsthost nat nowash no-ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64

Is this configuration wright. Would you help me to make wright configuration of SQM.

These are likely switchports, adding fq_codel to this will direct all switch traffic through the CPU, I would guess, so not a real option if you want line rate switching... A switch typically does not queue much and to be fast needs to operate in hardware...

If you want a typical sqm installation you should select your wan interface for sqm... as you did.

The configuration looks OK, you could add the word ingress to option iqdisc_opts 'nat dual-dsthost' and then maybe even increase option download '40000' to 46000 but that is not going to change much.

As that other post states, that should not be necessary, but if you tested and it improves things, by all means stick to it. BTW what does ethtool -k lan2 return?

1 Like
root@RB750Gr3:~# ethtool -k lan2
Features for lan2:
rx-checksumming: on [fixed]
tx-checksumming: on
	tx-checksum-ipv4: on [fixed]
	tx-checksum-ip-generic: off [fixed]
	tx-checksum-ipv6: on [fixed]
	tx-checksum-fcoe-crc: off [fixed]
	tx-checksum-sctp: off [fixed]
scatter-gather: on
	tx-scatter-gather: on [fixed]
	tx-scatter-gather-fraglist: off [fixed]
tcp-segmentation-offload: on
	tx-tcp-segmentation: on [fixed]
	tx-tcp-ecn-segmentation: off [fixed]
	tx-tcp-mangleid-segmentation: on [fixed]
	tx-tcp6-segmentation: on [fixed]
generic-segmentation-offload: off
generic-receive-offload: off
large-receive-offload: off [fixed]
rx-vlan-offload: off [fixed]
tx-vlan-offload: off [fixed]
ntuple-filters: off [fixed]
receive-hashing: off [fixed]
highdma: on [fixed]
rx-vlan-filter: on [fixed]
vlan-challenged: off [fixed]
tx-lockless: on [fixed]
netns-local: off [fixed]
tx-gso-robust: off [fixed]
tx-fcoe-segmentation: off [fixed]
tx-gre-segmentation: off [fixed]
tx-gre-csum-segmentation: off [fixed]
tx-ipxip4-segmentation: off [fixed]
tx-ipxip6-segmentation: off [fixed]
tx-udp_tnl-segmentation: off [fixed]
tx-udp_tnl-csum-segmentation: off [fixed]
tx-gso-partial: off [fixed]
tx-tunnel-remcsum-segmentation: off [fixed]
tx-sctp-segmentation: off [fixed]
tx-esp-segmentation: off [fixed]
tx-udp-segmentation: off [fixed]
tx-gso-list: off [fixed]
fcoe-mtu: off [fixed]
tx-nocache-copy: off
loopback: off [fixed]
rx-fcs: off [fixed]
rx-all: off [fixed]
tx-vlan-stag-hw-insert: off [fixed]
rx-vlan-stag-hw-parse: off [fixed]
rx-vlan-stag-filter: off [fixed]
l2-fwd-offload: off [fixed]
hw-tc-offload: on
esp-hw-offload: off [fixed]
esp-tx-csum-hw-offload: off [fixed]
rx-udp_tunnel-port-offload: off [fixed]
tls-hw-tx-offload: off [fixed]
tls-hw-rx-offload: off [fixed]
rx-gro-hw: off [fixed]
tls-hw-record: off [fixed]
rx-gro-list: off
macsec-hw-offload: off [fixed]
1 Like

@moeller0 After restart router, disabling tso, gso, gro with ethtool has reseted. How do I set this permanently.

That is hard, but for a best effort approach add these commands to /etc/rc.local. Unless these inrerface go away and come back up again this should help.

However I would very much try to reconfirm that this actually helps, cake deals with meta packets on its own and should not need that, that was more important for fq_codel on slower links.

1 Like

I have rebooted router. When I try to open some pages I decided to do iperf tests without ethtool commands. Here are sqm stats after serveral tests.

After loading several pages.

root@RB750Gr3:~# tc -s qdisc show dev wan
qdisc cake 8009: root refcnt 2 bandwidth 4320Kbit besteffort dual-srchost nat nowash ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 6474376 bytes 53282 pkt (dropped 2764, overlimits 28688 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 172636b of 4Mb
 capacity estimate: 4320Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       64 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh       4320Kbit
  target            5ms
  interval        100ms
  pk_delay        3.6ms
  av_delay        278us
  sp_delay         17us
  backlog            0b
  pkts            56046
  bytes         6694008
  way_inds          605
  way_miss         1234
  way_cols            0
  drops              32
  marks               2
  ack_drop         2732
  sp_flows            1
  bk_flows            1
  un_flows            0
  max_len         26388
  quantum           300

qdisc ingress ffff: parent ffff:fff1 ---------------- 
 Sent 81517391 bytes 68065 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0

 root@RB750Gr3:~# tc -s qdisc show dev ifb4wan
qdisc cake 800a: root refcnt 2 bandwidth 40Mbit besteffort dual-dsthost nat nowash ingress no-ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 83500623 bytes 68342 pkt (dropped 108, overlimits 38051 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 710973b of 4Mb
 capacity estimate: 40Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       68 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh         40Mbit
  target            5ms
  interval        100ms
  pk_delay       67.8ms
  av_delay         43ms
  sp_delay       28.7ms
  backlog            0b
  pkts            68450
  bytes        83650542
  way_inds          204
  way_miss         1175
  way_cols            0
  drops             108
  marks              10
  ack_drop            0
  sp_flows            0
  bk_flows            1
  un_flows            0
  max_len         21196
  quantum          1220

After tests for upload and download on the same time:

root@RB750Gr3:~# tc -s qdisc show dev wan
qdisc cake 8009: root refcnt 2 bandwidth 4320Kbit besteffort dual-srchost nat nowash ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 43373544 bytes 232967 pkt (dropped 25222, overlimits 204448 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 235080b of 4Mb
 capacity estimate: 4320Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       64 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh       4320Kbit
  target            5ms
  interval        100ms
  pk_delay        4.2ms
  av_delay        333us
  sp_delay         35us
  backlog            0b
  pkts           258189
  bytes        49166652
  way_inds          605
  way_miss         1369
  way_cols            0
  drops            3197
  marks               2
  ack_drop        22025
  sp_flows            2
  bk_flows            1
  un_flows            0
  max_len         26388
  quantum           300

qdisc ingress ffff: parent ffff:fff1 ---------------- 
 Sent 430714324 bytes 318697 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
root@RB750Gr3:~# tc -s qdisc show dev ifb4wan
qdisc cake 800a: root refcnt 2 bandwidth 40Mbit besteffort dual-dsthost nat nowash ingress no-ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 404851014 bytes 297183 pkt (dropped 21519, overlimits 238442 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 1574488b of 4Mb
 capacity estimate: 40Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       68 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh         40Mbit
  target            5ms
  interval        100ms
  pk_delay       3.53ms
  av_delay       1.43ms
  sp_delay         15us
  backlog            0b
  pkts           318702
  bytes       437349025
  way_inds          257
  way_miss         1304
  way_cols            0
  drops           21519
  marks              10
  ack_drop            0
  sp_flows           17
  bk_flows            2
  un_flows            0
  max_len         21196
  quantum          1220

After only upload test:

root@RB750Gr3:~# tc -s qdisc show dev wan
qdisc cake 8009: root refcnt 2 bandwidth 4320Kbit besteffort dual-srchost nat nowash ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 80982841 bytes 258096 pkt (dropped 28066, overlimits 235233 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 235080b of 4Mb
 capacity estimate: 4320Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       64 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh       4320Kbit
  target            5ms
  interval        100ms
  pk_delay       53.8ms
  av_delay       18.8ms
  sp_delay        170us
  backlog            0b
  pkts           286162
  bytes        91081765
  way_inds          605
  way_miss         1436
  way_cols            0
  drops            6041
  marks               2
  ack_drop        22025
  sp_flows           20
  bk_flows            1
  un_flows            0
  max_len         26388
  quantum           300

qdisc ingress ffff: parent ffff:fff1 ---------------- 
 Sent 432020444 bytes 340681 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0

root@RB750Gr3:~# tc -s qdisc show dev ifb4wan
qdisc cake 800a: root refcnt 2 bandwidth 40Mbit besteffort dual-dsthost nat nowash ingress no-ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 406467122 bytes 319184 pkt (dropped 21519, overlimits 238466 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 1574488b of 4Mb
 capacity estimate: 40Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       68 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh         40Mbit
  target            5ms
  interval        100ms
  pk_delay         38us
  av_delay         19us
  sp_delay         12us
  backlog            0b
  pkts           340703
  bytes       438965133
  way_inds          311
  way_miss         1369
  way_cols            0
  drops           21519
  marks              10
  ack_drop            0
  sp_flows            1
  bk_flows            1
  un_flows            0
  max_len         21196
  quantum          1220

After only download test:

root@RB750Gr3:~# tc -s qdisc show dev wan
qdisc cake 8009: root refcnt 2 bandwidth 4320Kbit besteffort dual-srchost nat nowash ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 94682093 bytes 437913 pkt (dropped 28076, overlimits 335623 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 235080b of 4Mb
 capacity estimate: 4320Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       64 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh       4320Kbit
  target            5ms
  interval        100ms
  pk_delay        3.3ms
  av_delay        266us
  sp_delay         33us
  backlog            0b
  pkts           465989
  bytes       104781797
  way_inds         9269
  way_miss         1475
  way_cols            0
  drops            6041
  marks               2
  ack_drop        22035
  sp_flows            5
  bk_flows            1
  un_flows            0
  max_len         26388
  quantum           300

qdisc ingress ffff: parent ffff:fff1 ---------------- 
 Sent 777380622 bytes 572260 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
root@RB750Gr3:~# tc -s qdisc show dev ifb4wan
qdisc cake 800a: root refcnt 2 bandwidth 40Mbit besteffort dual-dsthost nat nowash ingress no-ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 715032569 bytes 523272 pkt (dropped 48988, overlimits 427900 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 1705736b of 4Mb
 capacity estimate: 40Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       68 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh         40Mbit
  target            5ms
  interval        100ms
  pk_delay       2.21ms
  av_delay        563us
  sp_delay         16us
  backlog            0b
  pkts           572260
  bytes       789022110
  way_inds          329
  way_miss         1402
  way_cols            0
  drops           48988
  marks              10
  ack_drop            0
  sp_flows           13
  bk_flows            2
  un_flows            0
  max_len         21196
  quantum          1220
  • There is too much max_len in the all of the stats. When I run ethtool commands, max_len fixed to 1514.
  • There is high pk_delay and av_delay on both of page load and only upload tests.

What do you think about these stats.

That does not really matter per se, cake with the split-gso option will split these meta packers into normal ~1500 byte sized packets and send these out individually, so a 21196 byte meta packet will not cause problems...

However these download delay statistics after loading several pages look way toto large, the av_delay should be much closer to 5ms even under load. This might imply that your router is already partially CPU bound. What kind of rputer do you have and what software do you use on the router?

Also with the ethtool command issued do you still see the same high delay values?

Router is Mikrotik RB750Gr3. As you can see from image below, architecture is MediaTek MT7621 ver:1 eco:3. I have flashed with OpenWrt 22.03.3 r20028-43d71ad93e / LuCI openwrt-22.03 branch git-22.361.69894-438c598.

With ethtool command, I still see the same high delay values.

When I run these test, I have connected with Wifi 5Ghz. I have A+ on bufferbloat test, I can run these test with wired If you want.

After loading several pages.

root@RB750Gr3:~# tc -s qdisc show dev wan
qdisc cake 8005: root refcnt 2 bandwidth 4320Kbit besteffort dual-srchost nat nowash ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 268196 bytes 3893 pkt (dropped 692, overlimits 3459 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 67392b of 4Mb
 capacity estimate: 4320Kbit
 min/max network layer size:           28 /    1440
 min/max overhead-adjusted size:       64 /    1462
 average network hdr offset:           14

                  Tin 0
  thresh       4320Kbit
  target            5ms
  interval        100ms
  pk_delay       4.04ms
  av_delay        311us
  sp_delay         60us
  backlog            0b
  pkts             4585
  bytes          307832
  way_inds           43
  way_miss           45
  way_cols            0
  drops               0
  marks               0
  ack_drop          692
  sp_flows            0
  bk_flows            1
  un_flows            0
  max_len          1454
  quantum           300

qdisc ingress ffff: parent ffff:fff1 ---------------- 
 Sent 6015973 bytes 4612 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
root@RB750Gr3:~# tc -s qdisc show dev ifb4wan
qdisc cake 8006: root refcnt 2 bandwidth 40Mbit besteffort dual-dsthost nat nowash ingress no-ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 6374318 bytes 4827 pkt (dropped 11, overlimits 4444 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 406944b of 4Mb
 capacity estimate: 40Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       68 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh         40Mbit
  target            5ms
  interval        100ms
  pk_delay       46.6ms
  av_delay       27.2ms
  sp_delay       17.6ms
  backlog            0b
  pkts             4838
  bytes         6389043
  way_inds            0
  way_miss           44
  way_cols            0
  drops              11
  marks               0
  ack_drop            0
  sp_flows            0
  bk_flows            1
  un_flows            0
  max_len          1514
  quantum          1220

After tests for upload and download on the same time:

root@RB750Gr3:~# tc -s qdisc show dev wan
qdisc cake 8005: root refcnt 2 bandwidth 4320Kbit besteffort dual-srchost nat nowash ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 37247429 bytes 186014 pkt (dropped 25528, overlimits 185082 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 287712b of 4Mb
 capacity estimate: 4320Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       64 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh       4320Kbit
  target            5ms
  interval        100ms
  pk_delay       1.88ms
  av_delay        298us
  sp_delay         13us
  backlog            0b
  pkts           211542
  bytes        43106053
  way_inds           50
  way_miss          175
  way_cols            0
  drops            3246
  marks               0
  ack_drop        22282
  sp_flows           11
  bk_flows            1
  un_flows            0
  max_len          1514
  quantum           300

qdisc ingress ffff: parent ffff:fff1 ---------------- 
 Sent 358661252 bytes 256543 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
root@RB750Gr3:~# tc -s qdisc show dev ifb4wan
qdisc cake 8006: root refcnt 2 bandwidth 40Mbit besteffort dual-dsthost nat nowash ingress no-ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 325404775 bytes 232155 pkt (dropped 24388, overlimits 233722 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 1627776b of 4Mb
 capacity estimate: 40Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       68 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh         40Mbit
  target            5ms
  interval        100ms
  pk_delay       4.06ms
  av_delay        1.5ms
  sp_delay         18us
  backlog            0b
  pkts           256543
  bytes       362252854
  way_inds            1
  way_miss          172
  way_cols            0
  drops           24388
  marks               0
  ack_drop            0
  sp_flows           16
  bk_flows            1
  un_flows            0
  max_len          1514
  quantum          1220

After only upload test:

root@RB750Gr3:~# tc -s qdisc show dev wan
qdisc cake 8005: root refcnt 2 bandwidth 4320Kbit besteffort dual-srchost nat nowash ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 115136203 bytes 249130 pkt (dropped 31252, overlimits 256040 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 287712b of 4Mb
 capacity estimate: 4320Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       64 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh       4320Kbit
  target            5ms
  interval        100ms
  pk_delay       54.1ms
  av_delay       18.7ms
  sp_delay        628us
  backlog            0b
  pkts           280382
  bytes       129337856
  way_inds         1463
  way_miss         1161
  way_cols            0
  drops            8752
  marks               2
  ack_drop        22500
  sp_flows           21
  bk_flows            1
  un_flows            0
  max_len          1514
  quantum           300

qdisc ingress ffff: parent ffff:fff1 ---------------- 
 Sent 375026252 bytes 315250 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
root@RB750Gr3:~# tc -s qdisc show dev ifb4wan
qdisc cake 8006: root refcnt 2 bandwidth 40Mbit besteffort dual-dsthost nat nowash ingress no-ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 342565588 bytes 290843 pkt (dropped 24408, overlimits 241607 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 1627776b of 4Mb
 capacity estimate: 40Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       68 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh         40Mbit
  target            5ms
  interval        100ms
  pk_delay         44us
  av_delay         19us
  sp_delay         10us
  backlog            0b
  pkts           315251
  bytes       379439818
  way_inds         1057
  way_miss         1092
  way_cols            0
  drops           24408
  marks              44
  ack_drop            0
  sp_flows           15
  bk_flows            1
  un_flows            0
  max_len          1514
  quantum          1220

After only download test:

root@RB750Gr3:~# tc -s qdisc show dev wan
qdisc cake 8005: root refcnt 2 bandwidth 4320Kbit besteffort dual-srchost nat nowash ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 128905734 bytes 430225 pkt (dropped 31263, overlimits 354885 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 287712b of 4Mb
 capacity estimate: 4320Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       64 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh       4320Kbit
  target            5ms
  interval        100ms
  pk_delay       1.85ms
  av_delay        280us
  sp_delay         16us
  backlog            0b
  pkts           461488
  bytes       143108397
  way_inds         1490
  way_miss         1209
  way_cols            0
  drops            8752
  marks               2
  ack_drop        22511
  sp_flows            6
  bk_flows            1
  un_flows            0
  max_len          1514
  quantum           300

qdisc ingress ffff: parent ffff:fff1 ---------------- 
 Sent 722420345 bytes 547290 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0
root@RB750Gr3:~# tc -s qdisc show dev ifb4wan
qdisc cake 8006: root refcnt 2 bandwidth 40Mbit besteffort dual-dsthost nat nowash ingress no-ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 654204005 bytes 497069 pkt (dropped 50221, overlimits 461529 requeues 0) 
 backlog 0b 0p requeues 0
 memory used: 1669248b of 4Mb
 capacity estimate: 40Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       68 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh         40Mbit
  target            5ms
  interval        100ms
  pk_delay       3.52ms
  av_delay        883us
  sp_delay         15us
  backlog            0b
  pkts           547290
  bytes       730082405
  way_inds         1057
  way_miss         1141
  way_cols            0
  drops           50221
  marks              44
  ack_drop            0
  sp_flows           14
  bk_flows            2
  un_flows            0
  max_len          1514
  quantum          1220

Okay, a dual core 880 MHz MIPS, clearly not the fastest router on the planet... but properly configured it still should allow traffic shaping your aggregate ~55 Mbps...

Which implies that GSO/GRO meta packets are not your problem, so I would leave them enabled, as they help in reduce the oad on the router's networking stack...

Yes, please preferably with the router's radio disabled. When I, years ago tested a BT HomeHub5A (also dual cure MIPS, older and slower CPU cores though) I already ran into CPU limits when trying to traffic shape 50/10 and at the same time use the WiFi.

Maybe have a look here:

and see whether you could distribute the processing better over your CPUs to potentially gain a bit more throughput...

Also, if only for testing, switch your sqm configuration from piece_of_cake.qos/cake to simplest.qos/fq_codel, as that will do the following:
a) reduce the CPU load, as simplest is computationally a bit cheaper than cake
b) also HTB+fq_codel will on CPU overload tend to result in a loss in throughput with lower latency, while cake on CPU overload will show less throughput loss but a larger increase in latency.

Note the reported latency is calculated from the sojourn time of the packets in the queue, that is the time from entering the queue to leaving it again, if cake does not get the CPU when it would need want to transmit packets, it will send a few more packets on the next cycle (keeping throughput high) but that means all later packets see the delay in getting CPU as additional delay. This description is not 100% correct but should describe the underlaying principle reasonably well.

1 Like

You can also get marks, rather than drops, if you enable ecn on the host.

Are drops cheaper CPU-wise than drops?

Other than that yes I agree ECN can be nice and helpful. And many servers are already prepared to use ECN if only the endpoints ask for it (thst is the endpoint TCP stack negotiates to use ECN).
This can also, depending on the TCP stack result in somewhat higher goodput (less retranmissions).

Router doesn't have radio. So I have connected with TP-Link EAP245 AP.

Cable Modem <--> RB750Gr3 Router <--> TP-Link EAP245 AP

I have installed irqbalance and make same tests with wired. There was same high delays in the cake stats.

Also I have make bufferbloat test. While testing I have looked cake stats. Although I got A+ and low latency, there was high delays.

While downloading

root@RB750Gr3:~# tc -s qdisc show dev ifb4wan
qdisc cake 8012: root refcnt 2 bandwidth 40Mbit besteffort dual-dsthost nat nowash ingress no-ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 191247097 bytes 150852 pkt (dropped 5191, overlimits 108693 requeues 0) 
 backlog 161998b 107p requeues 0
 memory used: 774940b of 4Mb
 capacity estimate: 40Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       68 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh         40Mbit
  target            5ms
  interval        100ms
  pk_delay       49.5ms
  av_delay       22.9ms
  sp_delay         15ms
  backlog       161998b
  pkts           156150
  bytes       199229248
  way_inds          796
  way_miss          638
  way_cols            0
  drops            5191
  marks               0
  ack_drop            0
  sp_flows            0
  bk_flows            6
  un_flows            0
  max_len         16654
  quantum          1220

While uploading

root@RB750Gr3:~# tc -s qdisc show dev wan
qdisc cake 8011: root refcnt 2 bandwidth 4320Kbit besteffort dual-srchost nat nowash ack-filter split-gso rtt 100ms noatm overhead 22 mpu 64 
 Sent 50045258 bytes 171978 pkt (dropped 4138, overlimits 115433 requeues 0) 
 backlog 15994b 11p requeues 0
 memory used: 169268b of 4Mb
 capacity estimate: 4320Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       64 /    1522
 average network hdr offset:           14

                  Tin 0
  thresh       4320Kbit
  target            5ms
  interval        100ms
  pk_delay       43.4ms
  av_delay       17.9ms
  sp_delay       1.37ms
  backlog        15994b
  pkts           176127
  bytes        50845459
  way_inds          900
  way_miss          674
  way_cols            0
  drops             352
  marks               0
  ack_drop         3786
  sp_flows            1
  bk_flows            6
  un_flows            0
  max_len         14540
  quantum           300

qdisc ingress ffff: parent ffff:fff1 ---------------- 
 Sent 237422462 bytes 186461 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0

I have switched to fq_codel but I got A and higher latency than cake in bufferbloat test. How do I see delays for fq_codel like cake stats?

You can't really but try:
tc -s qdisc
tc -q qdisc
but uou need to do iy while the test still runs as the transient fq_codel stats are not kept very long. I also think they do not contain convenient measures of average and peak delay.