SQM, cake, piece_of_cake.qos — low performance (500 Mbps/500 Mbps connectivity)

I'm trying to setup SQM on my Xiaomi Router Pro (mir3p) running latest LEDE snapshot.

  • The router in question uses a MT7621A SoC (2x880 MHz MIPS 1004Kc V2.15, 4 logical processors total).
  • My ISP provides 500 Mbps/500 Mbps connectivity directly via Ethernet.

Note that I'm not well versed in tc internals, so I'm just a user here.

From what I've been able to gather about cake, it was intended as a fast and undemanding scheduler for just about any device out there. However, piece_of_cake.qos (and any other QoS script that makes use of cake) only yields ~200 Mbps/300 Mbps max, tested with speedtest-cli from a high-performance machine connected to the router via Gigabit Ethernet.

$ ssh root@router cat /etc/config/sqm 

config queue 'eth1'
        option interface 'eth0.2'
        option download '500000'
        option upload '500000'
        option debug_logging '0'
        option verbosity '5'
        option enabled '1'
        option qdisc 'cake'
        option linklayer 'ethernet'
        option overhead '38'
        option qdisc_advanced '0'
        option script 'piece_of_cake.qos'

$ ssh root@router tc qdisc
qdisc noqueue 0: dev lo root refcnt 2 
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
qdisc noqueue 0: dev br-lan root refcnt 2 
qdisc noqueue 0: dev eth0.1 root refcnt 2 
qdisc cake 8024: dev eth0.2 root refcnt 2 bandwidth 500Mbit besteffort triple-isolate nonat nowash no-ack-filter split-gso rtt 100.0ms noatm overhead 38 
qdisc ingress ffff: dev eth0.2 parent ffff:fff1 ---------------- 
qdisc noqueue 0: dev wlan1 root refcnt 2 
qdisc cake 8025: dev ifb4eth0.2 root refcnt 2 bandwidth 500Mbit besteffort triple-isolate nonat wash no-ack-filter split-gso rtt 100.0ms noatm overhead 38

ssh operator@stratofortress speedtest-cli
Retrieving speedtest.net configuration...
Testing from Rostelecom (95.84.164.43)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Megafon (Moscow) [0.12 km]: 3.856 ms
Testing download speed................................................................................
Download: 192.06 Mbit/s
Testing upload speed......................................................................................................
Upload: 293.70 Mbit/s

The only QoS script that can produce >400 Mbps is simplest_tbf.qos (which appears to use fq_codel exclusively as the leaf qdisc, despite help stating that it sets up a "TBF rate limiter with your qdisc attached":

$ ssh root@router cat /etc/config/sqm 

config queue 'eth1'
        option interface 'eth0.2'
        option download '500000'
        option upload '500000'
        option debug_logging '0'
        option verbosity '5'
        option enabled '1'
        option qdisc 'cake'
        option linklayer 'ethernet'
        option overhead '38'
        option qdisc_advanced '0'
        option script 'simplest_tbf.qos'

$ ssh root@router tc qdisc
qdisc noqueue 0: dev lo root refcnt 2 
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
qdisc noqueue 0: dev br-lan root refcnt 2 
qdisc noqueue 0: dev eth0.1 root refcnt 2 
qdisc tbf 1: dev eth0.2 root refcnt 2 rate 500Mbit burst 62500b lat 300.0ms 
qdisc fq_codel 110: dev eth0.2 parent 1: limit 1001p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 
qdisc ingress ffff: dev eth0.2 parent ffff:fff1 ---------------- 
qdisc noqueue 0: dev wlan1 root refcnt 2 
qdisc tbf 1: dev ifb4eth0.2 root refcnt 2 rate 500Mbit burst 62500b lat 300.0ms 
qdisc fq_codel 110: dev ifb4eth0.2 parent 1: limit 1001p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn 

$ ssh operator@stratofortress speedtest-cli
Retrieving speedtest.net configuration...
Testing from Rostelecom (95.84.164.43)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Megafon (Moscow) [0.12 km]: 4.716 ms
Testing download speed................................................................................
Download: 432.92 Mbit/s
Testing upload speed......................................................................................................
Upload: 452.75 Mbit/s

Is this expected? If not, how can I improve throughput when using cake?

Also, why does simplest_tbf.qos force the use of fq_codel?

Yes.

You can't.
Cake is too computation intensive for those speeds. 880MHz MIPS is very likely not enough. You need some x86 based router, or possibly mvebu might be enough.

Do you really need SQM at that speed?

If yes, you might stick with simplest_tbf.qos with fq_codel, which is much simpler and does not provide that much logic, but may be enough to prevent buffer-bloat to come extent.

3 Likes

Fair enough. At least a straight answer.

Do you really need SQM at that speed?

Well, I do notice latency spikes when using the likes of BitTorrent and otherwise doing network-intensive stuff from my home server. I thought that SQM is the "proper" alternative to setting arbitrary bandwidth limits.

It is, to some extent. But QoS tools are made from perspective where you have surplus of computational power compared to the data transfer volume. Then you can spend a few CPU cycles in determining the optimal order of packets.

But with gigabit speeds with a home router that is not true any more, as the volume exceeds computational power.

With bittorrent and other known bulk transfer programs you should still set limits, if possible.

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