QoSmate: (Yet Another) Quality of Service Tool for OpenWrt

Here is the link to my pi4 openwrt build.

I enabled and restarted the qosmate, but it is again disabled. What could be the issue?

Alright, based on the latest part from your log, it appears that qosmate was stopped by something and then didn’t restart. It would have been best if you had shared this output with me right away, as we’re going a bit in circles here. Of course, it's also up to you to check your log for errors as well.

Does that mean you're now also having issues with qosmate not starting during a normal start/restart of the application, or do you mean it’s only after a reboot?

As I mentioned, it looks like the firmware is highly customized and may not even be using the standard fw4.

What is fw4ish?

In this case, I’m afraid I can’t be of much help. However, I saw that you opened an issue on GitHub... maybe someone there can assist you further. It does look, though, like development activity on that repository has been slow, so it might be worth considering a switch to vanilla OpenWrt.

Also, I gave you some tips earlier. Have you tried those out yet?

qosmate gets disabled every time my wan interface gets a new IP.

Then please help me build my own pi4 openwrt image without all these custom scripts etc.

I tried adding service qosmate restart to rc.local but still qosmate unable to start on its own after reboot.

Just use the default pi4 image.

3 Likes

How do you think the problem you described will be resolved if I cannot reproduce the issue and you simply ignore attempts to identify the error or its cause?

I reached out to you with questions and requested troubleshooting information 27 days ago, and you never got back to me. You probably didn't try any of the suggestions I provided or at least did not give me any feedback.

To be honest, I invest a lot of time to make the script as simple and user-friendly as possible for everyone. It would not be too much to ask for you to at least respond to the posts that take up a lot of my time and perhaps help other people as well.

4 Likes

@neil1 Are you still experiencing the reboot issue? If so, I've made a small improvement to the init script that should hopefully make it a bit more resilient to race conditions.

@BoltonUK Please also try these changes if you are still interested.

Update to the latest version by running:

service qosmate update

Then, reboot the router and check if the issue persists.

1 Like

Let me test it again. No power failure since then.

Now qosmate was shown running but my internet was not working. WAN interface was connected and getting an ip from the ISP but i was unable to browse or ping the internet. I tried rebooting the router 2 times but still same issue. Here are the logs. And I am back to using qosify.
QoSmate log

I doubt that the minor change I made is the reason you’re experiencing connection issues now. In the init script, I only adjusted the restart behavior:

Now, when the service is restarted (such as during a hotplug event), the script doesn’t disable and re-enable the service, it only disables it if it receives a "manual" stop command. This change should have no effect on your internet connection but should hopefully make the script a bit more robust.

My guess is that you’re experiencing issues because qosify and qosmate are both active simultaneously. As I mentioned in the README, all other QoS tools should be stopped and disabled when using qosmate.

Wed Oct 30 17:47:09 2024 daemon.info qosify: start interface pppoe-wan

Stop and disable qosify, then restart your router.
Wait 2–3 minutes, then check if qosmate is active and enabled and if you have an internet connection.

1 Like

Hello, in case it helps tell you that in my case the problem you are talking about that the script does not start after startup is for several reasons. The first is that it stops starting automatically when any change is made to the firewall, whether it is opening a port or any modification. Second is when your wan connection changes ip automatically and third the script does not start after the reboot if you have not previously enabled and restarted the script. This is what happened to me, in case it helps you.

QoSmate is enabled and shown running and the internet is working but QoS functionality is not being applied.


service qosmate status
==== qosmate Status ====
qosmate service is enabled.
No qosmate traffic shaping is active on the egress interface (pppoe-wan).
Traffic shaping is not active on the ingress interface (ifb-pppoe-wan).
==== Overall Status ====
qosmate is not currently active or managing traffic shaping.
==== Current Settings ====
Upload rate: 15000 kbps
Download rate: 45000 kbps
Game traffic upload: 2650 (Default value) kbps
Game traffic download: 7150 (Default value) kbps
Queue discipline: CAKE (Root qdisc)
==== Package Status ====
All required packages are installed.

==== Detailed Technical Information ====
Traffic Control (tc) Queues:
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 mq 0: dev eth0 root
 Sent 3253216668 bytes 2544862 pkt (dropped 0, overlimits 0 requeues 55)
 backlog 0b 0p requeues 55
qdisc fq_codel 0: dev eth0 parent :5 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 617938715 bytes 477299 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 1506 drop_overlimit 0 new_flow_count 1602 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 1804424906 bytes 1444048 pkt (dropped 0, overlimits 0 requeues 4)
 backlog 0b 0p requeues 4
  maxpacket 1506 drop_overlimit 0 new_flow_count 2999 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 1583815 bytes 4298 pkt (dropped 0, overlimits 0 requeues 8)
 backlog 0b 0p requeues 8
  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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 6215556 bytes 7190 pkt (dropped 0, overlimits 0 requeues 39)
 backlog 0b 0p requeues 39
  maxpacket 16654 drop_overlimit 0 new_flow_count 3 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 823053676 bytes 612027 pkt (dropped 0, overlimits 0 requeues 4)
 backlog 0b 0p requeues 4
  maxpacket 1390 drop_overlimit 0 new_flow_count 4 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth1 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 149062008 bytes 1074949 pkt (dropped 0, overlimits 0 requeues 272)
 backlog 0b 0p requeues 272
  maxpacket 1514 drop_overlimit 0 new_flow_count 779 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 eth1.10 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth1.20 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev pppoe-wan root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 124858628 bytes 1071428 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 4476 drop_overlimit 0 new_flow_count 7118 ecn_mark 0
  new_flows_len 0 old_flows_len 0

==== Nftables Ruleset (dscptag) ====

==== Custom Rules Table Status ====
Custom rules table (qosmate_custom) is not active or doesn't exist.

new log

QoSmate log

can you show output of tc -s qdisc, after running a speedtest please. I had a issue on another firmware and cake-qos with my NanoPI R6S when using ifb-pppoe, wondering if its a similar problem. To get round that issue i used a cake instance on eth1 (br-lan) and eth0 (pppoe-wan) and not ifb. Its not a issue on Offical Openwrt.

root@OpenWrt:~# service qosmate status
==== qosmate Status ====
qosmate service is enabled.
Traffic shaping is active on the egress interface (pppoe-wan).
Traffic shaping is active on the ingress interface (ifb-pppoe-wan).
==== Overall Status ====
qosmate is currently active and managing traffic shaping.
==== Current Settings ====
Upload rate: 101772 kbps
Download rate: 824553 kbps
Game traffic upload: 15665 (Default value) kbps
Game traffic download: 124082 (Default value) kbps
Queue discipline: CAKE (Root qdisc)
==== Package Status ====
All required packages are installed.

==== Detailed Technical Information ====
Traffic Control (tc) Queues:
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 mq 0: dev eth0 root
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev eth0 parent :2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 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 mq 0: dev eth1 root
 Sent 26954279503 bytes 224322897 pkt (dropped 0, overlimits 0 requeues 5)
 backlog 0b 0p requeues 5
qdisc fq_codel 0: dev eth1 parent :2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 16303948313 bytes 137115457 pkt (dropped 0, overlimits 0 requeues 1)
 backlog 0b 0p requeues 1
  maxpacket 102 drop_overlimit 0 new_flow_count 1 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 10650331190 bytes 87207440 pkt (dropped 0, overlimits 0 requeues 4)
 backlog 0b 0p requeues 4
  maxpacket 324 drop_overlimit 0 new_flow_count 5 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc mq 0: dev eth2 root
 Sent 521882355782 bytes 361704163 pkt (dropped 0, overlimits 0 requeues 149920)
 backlog 0b 0p requeues 149920
qdisc fq_codel 0: dev eth2 parent :2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 306368553949 bytes 211148268 pkt (dropped 0, overlimits 0 requeues 106941)
 backlog 0b 0p requeues 106941
  maxpacket 65102 drop_overlimit 0 new_flow_count 239260 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth2 parent :1 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 215513801833 bytes 150555895 pkt (dropped 0, overlimits 0 requeues 42979)
 backlog 0b 0p requeues 42979
  maxpacket 62074 drop_overlimit 0 new_flow_count 67440 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 cake 801e: dev pppoe-wan root refcnt 2 bandwidth 101772Kbit diffserv4 triple-isolate nonat wash no-ack-filter split-gso rtt 100ms noatm overhead 38 mpu 84
 Sent 2727238900 bytes 19858385 pkt (dropped 35, overlimits 5521811 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 511Kb of 5088600b
 capacity estimate: 101772Kbit
 min/max network layer size:           29 /    1492
 min/max overhead-adjusted size:       84 /    1530
 average network hdr offset:            0

                   Bulk  Best Effort        Video        Voice
  thresh       6360Kbit   101772Kbit    50886Kbit    25443Kbit
  target            5ms          5ms          5ms          5ms
  interval        100ms        100ms        100ms        100ms
  pk_delay        854us        169us        181us       1.05ms
  av_delay        272us          9us         34us        159us
  sp_delay          2us          0us          1us          2us
  backlog            0b           0b           0b           0b
  pkts          9317534      9040336       874842       625708
  bytes       657819416   1479218016    321873053    268379569
  way_inds            0       563487        13920         1893
  way_miss         1542        86732        32206        17619
  way_cols            0            0            0            0
  drops               2           26            6            1
  marks               2            1            0            0
  ack_drop            0            0            0            0
  sp_flows            1            4            0            0
  bk_flows            0            0            0            0
  un_flows            0            0            0            0
  max_len         67500        67712        66600        61684
  quantum           300         1514         1514          776

qdisc ingress ffff: dev pppoe-wan parent ffff:fff1 ----------------
 Sent 117135685168 bytes 81853162 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 801f: dev ifb-pppoe-wan root refcnt 2 bandwidth 824553Kbit diffserv4 triple-isolate nonat nowash no-ack-filter split-gso rtt 100ms noatm overhead 38 mpu 84
 Sent 117135641679 bytes 81853130 pkt (dropped 32, overlimits 108325735 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 1697280b of 15140Kb
 capacity estimate: 824553Kbit
 min/max network layer size:           28 /    1492
 min/max overhead-adjusted size:       84 /    1530
 average network hdr offset:            0

                   Bulk  Best Effort        Video        Voice
  thresh      51534Kbit   824553Kbit   412276Kbit   206138Kbit
  target            5ms          5ms          5ms          5ms
  interval        100ms        100ms        100ms        100ms
  pk_delay        160us         30us         29us        182us
  av_delay         35us         18us          6us         63us
  sp_delay          3us          0us          0us          2us
  backlog            0b           0b           0b           0b
  pkts         58086347     21283481      1591377       891957
  bytes     85004427204  29755064876   1616761850    759431238
  way_inds       570530       821968        22398         2638
  way_miss         1589        90665        34527        16159
  way_cols            0            0            0            0
  drops               9           23            0            0
  marks               0            5            0            0
  ack_drop            0            0            0            0
  sp_flows            0            1            1            1
  bk_flows            0            1            0            0
  un_flows            0            0            0            0
  max_len          1492         1492         1492         1480
  quantum          1514         1514         1514         1514


==== Nftables Ruleset (dscptag) ====
        chain dscptag {
                type filter hook forward priority filter; policy accept;
                meta priority set ip dscp map @priomap counter packets 68472848 bytes 80575636728
                meta priority set ip6 dscp map @priomap counter packets 30615234 bytes 38336910197
                ct mark set ip dscp | 0x80 counter packets 69770157 bytes 81448861551
                ct mark set ip6 dscp | 0x80 counter packets 30615234 bytes 38336910197
        }
}

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 mq 0: dev eth0 root
 Sent 6284515121 bytes 4922434 pkt (dropped 0, overlimits 0 requeues 62)
 backlog 0b 0p requeues 62
qdisc fq_codel 0: dev eth0 parent :5 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 2089899162 bytes 1603615 pkt (dropped 0, overlimits 0 requeues 2)
 backlog 0b 0p requeues 2
  maxpacket 1514 drop_overlimit 0 new_flow_count 3333 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 2388355957 bytes 1919269 pkt (dropped 0, overlimits 0 requeues 4)
 backlog 0b 0p requeues 4
  maxpacket 1506 drop_overlimit 0 new_flow_count 3144 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 2282539 bytes 9073 pkt (dropped 0, overlimits 0 requeues 11)
 backlog 0b 0p requeues 11
  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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 6624362 bytes 11435 pkt (dropped 0, overlimits 0 requeues 39)
 backlog 0b 0p requeues 39
  maxpacket 16654 drop_overlimit 0 new_flow_count 3 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 1797353101 bytes 1379042 pkt (dropped 0, overlimits 0 requeues 6)
 backlog 0b 0p requeues 6
  maxpacket 1390 drop_overlimit 0 new_flow_count 8 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth1 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 332772760 bytes 1826181 pkt (dropped 6, overlimits 0 requeues 625)
 backlog 0b 0p requeues 625
  maxpacket 1514 drop_overlimit 0 new_flow_count 1516 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 eth1.10 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth1.20 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev pppoe-wan root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 291837656 bytes 1819396 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 10444 drop_overlimit 0 new_flow_count 13444 ecn_mark 0
  new_flows_len 0 old_flows_len 0

It only looks like QoSmate is running, but the function that displays the service status in the UI simply checks whether the enabled '1' option is set in the configuration. If it’s enabled, the status is shown as "running", if disabled, it’s shown as "not running." This is a very basic and error-prone way to determine if the service is actually running, but it has generally worked so far. The reason is that each time the hotplug script or a manual restart was triggered, the configuration was temporarily set to disabled and then back to enabled. Naturally, if the service was stopped, the configuration remained disabled, which generally led to the UI displaying the correct status.

The changes I've implemented yesterday is only set to disabled in the configuration if the stop command is explicitly given manually, not during a restart. This likely means that, in your case, the hotplug attempted to restart the script, stopped it, and, probably due to a race condition, the script was prevented from starting or continuing successfully—though it’s hard to pinpoint exactly. To be honest, it’s difficult to say precisely what’s causing the issue.

For now don't focus to much on the UI service status to determine if the service is running. Just use:

service qosmate status

@choppyc I'm not sure if the pppoe-wan interface or even the ifb interface is really the cause of the problem. If you look at his last logs and check the last point where QoSmate stops and then doesn’t restart, no new devices are coming up or going down after that.

Thu Oct 31 15:00:52 2024 user.notice fw4ish: /etc/custom/nft.user reload
Thu Oct 31 15:00:52 2024 user.notice nft.user: no actions until optional
Thu Oct 31 15:00:52 2024 user.notice qosmate: Service started
Thu Oct 31 15:00:52 2024 daemon.info procd: - init complete -
Thu Oct 31 15:00:53 2024 user.notice fw4ish: /etc/custom/nft.user reload
Thu Oct 31 15:00:53 2024 user.notice nft.user: no actions until optional
Thu Oct 31 15:00:53 2024 user.notice qosmate: Service stopped
Thu Oct 31 15:00:55 2024 user.notice fw4ish: /etc/custom/nft.user reload
Thu Oct 31 15:00:55 2024 user.notice nft.user: no actions until optional

So I guess it's a timing issue

There is no qdisc active because qosmate was stopped (which deletes all tc rules) and never started

service qosmate status
==== qosmate Status ====
qosmate service is enabled.
No qosmate traffic shaping is active on the egress interface (pppoe-wan).
Traffic shaping is not active on the ingress interface (ifb-pppoe-wan).
==== Overall Status ====
qosmate is not currently active or managing traffic shaping.
==== Current Settings ====
Upload rate: 15000 kbps
Download rate: 45000 kbps
Game traffic upload: 2650 (Default value) kbps
Game traffic download: 7150 (Default value) kbps
Queue discipline: CAKE (Root qdisc)
==== Package Status ====
All required packages are installed.

==== Detailed Technical Information ====
Traffic Control (tc) Queues:
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 mq 0: dev eth0 root
 Sent 3253216668 bytes 2544862 pkt (dropped 0, overlimits 0 requeues 55)
 backlog 0b 0p requeues 55
qdisc fq_codel 0: dev eth0 parent :5 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 617938715 bytes 477299 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 1506 drop_overlimit 0 new_flow_count 1602 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 1804424906 bytes 1444048 pkt (dropped 0, overlimits 0 requeues 4)
 backlog 0b 0p requeues 4
  maxpacket 1506 drop_overlimit 0 new_flow_count 2999 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 1583815 bytes 4298 pkt (dropped 0, overlimits 0 requeues 8)
 backlog 0b 0p requeues 8
  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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 6215556 bytes 7190 pkt (dropped 0, overlimits 0 requeues 39)
 backlog 0b 0p requeues 39
  maxpacket 16654 drop_overlimit 0 new_flow_count 3 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 823053676 bytes 612027 pkt (dropped 0, overlimits 0 requeues 4)
 backlog 0b 0p requeues 4
  maxpacket 1390 drop_overlimit 0 new_flow_count 4 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth1 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 149062008 bytes 1074949 pkt (dropped 0, overlimits 0 requeues 272)
 backlog 0b 0p requeues 272
  maxpacket 1514 drop_overlimit 0 new_flow_count 779 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 eth1.10 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth1.20 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev pppoe-wan root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 124858628 bytes 1071428 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 4476 drop_overlimit 0 new_flow_count 7118 ecn_mark 0
  new_flows_len 0 old_flows_len 0

==== Nftables Ruleset (dscptag) ====

==== Custom Rules Table Status ====
Custom rules table (qosmate_custom) is not active or doesn't exist.
[root@dca632 / 55°]# 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 mq 0: dev eth0 root
 Sent 6284515121 bytes 4922434 pkt (dropped 0, overlimits 0 requeues 62)
 backlog 0b 0p requeues 62
qdisc fq_codel 0: dev eth0 parent :5 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 2089899162 bytes 1603615 pkt (dropped 0, overlimits 0 requeues 2)
 backlog 0b 0p requeues 2
  maxpacket 1514 drop_overlimit 0 new_flow_count 3333 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 2388355957 bytes 1919269 pkt (dropped 0, overlimits 0 requeues 4)
 backlog 0b 0p requeues 4
  maxpacket 1506 drop_overlimit 0 new_flow_count 3144 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 2282539 bytes 9073 pkt (dropped 0, overlimits 0 requeues 11)
 backlog 0b 0p requeues 11
  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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 6624362 bytes 11435 pkt (dropped 0, overlimits 0 requeues 39)
 backlog 0b 0p requeues 39
  maxpacket 16654 drop_overlimit 0 new_flow_count 3 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 1797353101 bytes 1379042 pkt (dropped 0, overlimits 0 requeues 6)
 backlog 0b 0p requeues 6
  maxpacket 1390 drop_overlimit 0 new_flow_count 8 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth1 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 332772760 bytes 1826181 pkt (dropped 6, overlimits 0 requeues 625)
 backlog 0b 0p requeues 625
  maxpacket 1514 drop_overlimit 0 new_flow_count 1516 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 eth1.10 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth1.20 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev pppoe-wan root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 291837656 bytes 1819396 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 10444 drop_overlimit 0 new_flow_count 13444 ecn_mark 0
  new_flows_len 0 old_flows_len 0
[root@dca632 / 54°]# service qosmate status
==== qosmate Status ====
qosmate service is enabled.
No qosmate traffic shaping is active on the egress interface (pppoe-wan).
Traffic shaping is not active on the ingress interface (ifb-pppoe-wan).
==== Overall Status ====
qosmate is not currently active or managing traffic shaping.
==== Current Settings ====
Upload rate: 15000 kbps
Download rate: 45000 kbps
Game traffic upload: 2650 (Default value) kbps
Game traffic download: 7150 (Default value) kbps
Queue discipline: CAKE (Root qdisc)
==== Package Status ====
All required packages are installed.

==== Detailed Technical Information ====
Traffic Control (tc) Queues:
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 mq 0: dev eth0 root
 Sent 7607507432 bytes 5951961 pkt (dropped 0, overlimits 0 requeues 95)
 backlog 0b 0p requeues 95
qdisc fq_codel 0: dev eth0 parent :5 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 2693484222 bytes 2074530 pkt (dropped 0, overlimits 0 requeues 9)
 backlog 0b 0p requeues 9
  maxpacket 1514 drop_overlimit 0 new_flow_count 3716 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 2571120342 bytes 2067804 pkt (dropped 0, overlimits 0 requeues 28)
 backlog 0b 0p requeues 28
  maxpacket 16654 drop_overlimit 0 new_flow_count 3169 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 2997408 bytes 11321 pkt (dropped 0, overlimits 0 requeues 12)
 backlog 0b 0p requeues 12
  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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 6784494 bytes 12941 pkt (dropped 0, overlimits 0 requeues 39)
 backlog 0b 0p requeues 39
  maxpacket 16654 drop_overlimit 0 new_flow_count 3 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 2333120966 bytes 1785365 pkt (dropped 0, overlimits 0 requeues 7)
 backlog 0b 0p requeues 7
  maxpacket 1390 drop_overlimit 0 new_flow_count 9 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth1 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 436965497 bytes 2161896 pkt (dropped 6, overlimits 0 requeues 909)
 backlog 0b 0p requeues 909
  maxpacket 1514 drop_overlimit 0 new_flow_count 1873 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 eth1.10 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth1.20 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev pppoe-wan root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 388639519 bytes 2154774 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  maxpacket 10444 drop_overlimit 0 new_flow_count 13781 ecn_mark 0
  new_flows_len 0 old_flows_len 0

==== Nftables Ruleset (dscptag) ====

==== Custom Rules Table Status ====
Custom rules table (qosmate_custom) is not active or doesn't exist.

after starting the qosmate service in luci ui. It is working again.

 service qosmate status
==== qosmate Status ====
qosmate service is enabled.
Traffic shaping is active on the egress interface (pppoe-wan).
Traffic shaping is active on the ingress interface (ifb-pppoe-wan).
==== Overall Status ====
qosmate is currently active and managing traffic shaping.
==== Current Settings ====
Upload rate: 15000 kbps
Download rate: 45000 kbps
Game traffic upload: 2650 (Default value) kbps
Game traffic download: 7150 (Default value) kbps
Queue discipline: CAKE (Root qdisc)
==== Package Status ====
All required packages are installed.

==== Detailed Technical Information ====
Traffic Control (tc) Queues:
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 mq 0: dev eth0 root
 Sent 7641814299 bytes 5989223 pkt (dropped 0, overlimits 0 requeues 123)
 backlog 0b 0p requeues 123
qdisc fq_codel 0: dev eth0 parent :5 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 2707812037 bytes 2095583 pkt (dropped 0, overlimits 0 requeues 13)
 backlog 0b 0p requeues 13
  maxpacket 4796 drop_overlimit 0 new_flow_count 3792 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 2571756807 bytes 2068920 pkt (dropped 0, overlimits 0 requeues 28)
 backlog 0b 0p requeues 28
  maxpacket 16654 drop_overlimit 0 new_flow_count 3169 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 3680951 bytes 12144 pkt (dropped 0, overlimits 0 requeues 36)
 backlog 0b 0p requeues 36
  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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 6818645 bytes 13183 pkt (dropped 0, overlimits 0 requeues 39)
 backlog 0b 0p requeues 39
  maxpacket 16654 drop_overlimit 0 new_flow_count 3 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 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 2351745859 bytes 1799393 pkt (dropped 0, overlimits 0 requeues 7)
 backlog 0b 0p requeues 7
  maxpacket 1390 drop_overlimit 0 new_flow_count 9 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc fq_codel 0: dev eth1 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 452742653 bytes 2183208 pkt (dropped 6, overlimits 0 requeues 1002)
 backlog 0b 0p requeues 1002
  maxpacket 1514 drop_overlimit 0 new_flow_count 2006 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 eth1.10 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth1.20 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 800b: dev pppoe-wan root refcnt 2 bandwidth 15Mbit diffserv4 dual-srchost nat wash no-ack-filter split-gso rtt 100ms raw overhead 0
 Sent 1081972 bytes 2073 pkt (dropped 1, overlimits 2121 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 165120b of 4Mb
 capacity estimate: 15Mbit
 min/max network layer size:           40 /    1480
 min/max overhead-adjusted size:       40 /    1480
 average network hdr offset:            0

                   Bulk  Best Effort        Video        Voice
  thresh      937496bit       15Mbit     7500Kbit     3750Kbit
  target         19.4ms          5ms          5ms          5ms
  interval        114ms        100ms        100ms        100ms
  pk_delay          0us        611us       25.5ms          0us
  av_delay          0us         98us       5.61ms          0us
  sp_delay          0us          2us         95us          0us
  backlog            0b           0b           0b           0b
  pkts                0          293         1781            0
  bytes               0        47934      1035268            0
  way_inds            0            0            0            0
  way_miss            0           14           35            0
  way_cols            0            0            0            0
  drops               0            0            1            0
  marks               0            0            0            0
  ack_drop            0            0            0            0
  sp_flows            0            0            1            0
  bk_flows            0            1            0            0
  un_flows            0            0            0            0
  max_len             0         1278         5525            0
  quantum           300          457          300          300

qdisc ingress ffff: dev pppoe-wan parent ffff:fff1 ----------------
 Sent 3507402 bytes 3486 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 800c: dev ifb-pppoe-wan root refcnt 2 bandwidth 45Mbit diffserv4 dual-dsthost nat wash ingress no-ack-filter split-gso rtt 100ms raw overhead 0
 Sent 3504846 bytes 3484 pkt (dropped 1, overlimits 4049 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 50Kb of 4Mb
 capacity estimate: 45Mbit
 min/max network layer size:           40 /    1492
 min/max overhead-adjusted size:       40 /    1492
 average network hdr offset:            0

                   Bulk  Best Effort        Video        Voice
  thresh       2812Kbit       45Mbit    22500Kbit    11250Kbit
  target         6.46ms          5ms          5ms          5ms
  interval        101ms        100ms        100ms        100ms
  pk_delay          0us       1.01ms       2.69ms          0us
  av_delay          0us        309us        484us          0us
  sp_delay          0us          3us          1us          0us
  backlog            0b           0b           0b           0b
  pkts                0         1529         1956            0
  bytes               0      1890140      1616158            0
  way_inds            0            0            0            0
  way_miss            0           19           35            0
  way_cols            0            0            0            0
  drops               0            0            1            0
  marks               0            0            0            0
  ack_drop            0            0            0            0
  sp_flows            0            1            2            0
  bk_flows            0            1            0            0
  un_flows            0            0            0            0
  max_len             0         1452         1492            0
  quantum           300         1373          686          343


==== Nftables Ruleset (dscptag) ====
        chain dscptag {
                type filter hook forward priority filter; policy accept;
                ip protocol udp udp sport 51413 ip dscp set cs1 counter packets 0 bytes 0
                ip6 nexthdr udp udp sport 51413 ip6 dscp set cs1 counter packets 0 bytes 0
                ip protocol udp udp dport 51413 ip dscp set cs1 counter packets 0 bytes 0
                ip6 nexthdr udp udp dport 51413 ip6 dscp set cs1 counter packets 0 bytes 0
                ip protocol tcp tcp sport { 6881-6889, 51413 } ip dscp set cs1 counter packets 0 bytes 0
                ip6 nexthdr tcp tcp sport { 6881-6889, 51413 } ip6 dscp set cs1 counter packets 0 bytes 0
                ip protocol tcp tcp dport { 6881-6889, 51413 } ip dscp set cs1 counter packets 0 bytes 0
                ip6 nexthdr tcp tcp dport { 6881-6889, 51413 } ip6 dscp set cs1 counter packets 0 bytes 0
                ip protocol tcp tcp flags & ack == ack meta length < 100 add @xfst4ack { ip daddr . ip saddr . tcp dport . tcp sport limit rate over 75000/second } counter packets 2 bytes 104 jump drop995
                ip protocol tcp tcp flags & ack == ack meta length < 100 add @fast4ack { ip daddr . ip saddr . tcp dport . tcp sport limit rate over 7500/second } counter packets 77 bytes 4436 jump drop95
                ip protocol tcp tcp flags & ack == ack meta length < 100 add @med4ack { ip daddr . ip saddr . tcp dport . tcp sport limit rate over 750/second } counter packets 395 bytes 22405 jump drop50
                ip protocol tcp tcp flags & ack == ack meta length < 100 add @slow4ack { ip daddr . ip saddr . tcp dport . tcp sport limit rate over 750/second } counter packets 195 bytes 11159 jump drop50
                ip protocol tcp ct bytes < 2812500 ip dscp < cs4 ip dscp set cs0 counter packets 4773 bytes 4195693
                ip protocol tcp ct bytes > 56250000 ip dscp < cs4 ip dscp set cs1 counter packets 0 bytes 0
                ip protocol tcp add @slowtcp4 { ip saddr . ip daddr . tcp sport . tcp dport limit rate 150/second burst 150 packets } ip dscp set af42 counter packets 3479 bytes 2331039
                ip6 nexthdr tcp add @slowtcp6 { ip6 saddr . ip6 daddr . tcp sport . tcp dport limit rate 150/second burst 150 packets } ip6 dscp set af42 counter packets 0 bytes 0
                meta priority set ip dscp map @priomap counter packets 5474 bytes 4582098
                meta priority set ip6 dscp map @priomap counter packets 0 bytes 0
                meta nfproto ipv4 ct mark set @nh,8,8 & 0xfc [invalid type] | 0x80 counter packets 7543 bytes 7429042
                meta nfproto ipv6 ct mark set @nh,0,16 & 0xfc0 [invalid type] | 0x80 counter packets 0 bytes 0
        }
}

==== Custom Rules Table Status ====
Custom rules table (qosmate_custom) is active.
Current custom rules:
table inet qosmate_custom {
}

Yea, this is expected. Are you willing and ready to perform a few tests?

1 Like

yes sure. I will perform tests for you.

Hi, I am trying to rewrite nftables 4-tuple classifier with conntrack equivalent.
If anyone can test in 2 following cases (either or both):

  • You are almost certain BW is limited by router's (lack of) brainpower (100mbps 7628 jumps from joy now, but I lack objective opinion in faster link and weak SoC)
  • no-NAT setup where UDP stream may get new classification, even inverted if 2 minutes idle

Diff for examination: https://github.com/hudra0/qosmate/pull/7
Or quick install:

EDIT See slightly improved version at QoSmate: (Yet Another) Quality of Service Tool for OpenWrt - #431 by brada4 instead.

cp /etc/qosmate.sh /etc/qosmate.sh_BAK
wget -O /etc/qosmate.sh https://github.com/hudra0/qosmate/raw/7d1a06952c3b6ac3b310abc49f94a4ee83be2e9d/etc/qosmate.sh

2 Likes

Hi brada4,

I have tested the first scenario on MT6000, not the weakest soc, but, at least now I can hit gigabit, prior this change I was reaching 700-750 mb.

Could you please detail how second scenario can be tested? its not clear for me.

Thanks.
BR