What's new

CakeQOS CakeQOS-Merlin

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

To do:
Hourly (or so) cronjob to check if everything is ok and running.

Added to roadmap..

Added additional credits/inspiration to Post 1....

A fair bit of the script development was also from past works here, including but not limited to @Jack Yaz, @Martineau and @rgnldo!
 
Last edited:
in my case upload is always using cake. never seen it to switch to something different ...
 
just found an interesting situation.

my UL contracted speed is 15Mbps and i normally get it. many times even 20Mbps.

so i specified 10Mbps for UL limit when i enabled cake.
all fine during the weekend.

today the latency would shot high up when saturating the UL line. maybe cake problem i thought?

nope.

problem is that on a weekday during working hours my comcast UL drops to 5Mbps. lower than the 10Mbps limit i set for cake.

once i re set UL limit to 4Mbps, no more packet loss.

lesson learned: it appears that if line speeds go below the limits you set for cake, there's no magic cake can do.
sorry if this was obvious. it hadn't occurred to me and i though it was interesting to post.

it's almost like having something to monitor current line speeds and adjust cake limits would make sense?
 
it's almost like having something to monitor current line speeds and adjust cake limits would make sense?
That would be a cool script to use the data collected by YazFi's spdMerlin to make on the fly adjustments for cakeQoS.
 
admin@RT-AX88U-E960:/tmp/home/root# /jffs/scripts/cake-qos update ax88u
New CakeQOS-Merlin detected (v0.0.5, currently running v0.0.4), updating...
Your cake binaries are up-to-date.
/jffs/scripts/cake-qos: line 298: syntax error: unexpected ")"
admin@RT-AX88U-E960:/tmp/home/root#

Im getting this error also, when trying to update


EDIT: tired it again, now I get this, so I guess its working

admin@RT-AX88U-E960:/tmp/home/root# /jffs/scripts/cake-qos update
CakeQOS-Merlin - v0.0.5: You are running the latest CakeQOS-Merlin script (v0.0.5, currently running v0.0.5), skipping...
CakeQOS-Merlin - v0.0.5: Your cake binaries are up-to-date.
admin@RT-AX88U-E960:/tmp/home/root#


admin@RT-AX88U-E960:/tmp/home/root# /jffs/scripts/cake-qos status
CakeQOS-Merlin - v0.0.5: Running...
CakeQOS-Merlin - v0.0.5: > Download Status:
CakeQOS-Merlin - v0.0.5: qdisc cake 8004: dev ifb9eth0 root refcnt 2 bandwidth 100Mbit besteffort triple-isolate nat wash ingress ack-filter split-gso rtt 100.0ms noatm overhead 18 mpu 64 no-sce
CakeQOS-Merlin - v0.0.5: > Upload Status:
CakeQOS-Merlin - v0.0.5: qdisc cake 8003: dev eth0 root refcnt 2 bandwidth 10Mbit besteffort triple-isolate nat nowash ack-filter split-gso rtt 100.0ms noatm overhead 18 mpu 64 no-sce
admin@RT-AX88U-E960:/tmp/home/root#
 
v0.0.5 released! Many many thanks to @maghuro for making this release happen and to everyone for testing.

Changelog:

- Now autodetects router model, meaning you do not need to manually enter your router model for the install and update commands anymore
- Added to /opt/bin to now be able to run commands simply by entering "cake-qos install" for example, instead of "/jffs/scripts/cake-qos install"
- Now binds to nat-start
- Added MD5 check to update as an additional check for any script updates
- Added more intuitive log messages

And as @ttgapers mentioned, @Jack Yaz, @Martineau and @rgnldo have also contributed to this.
 
v0.0.5 released! Many many thanks to @maghuro for making this release happen and to everyone for testing.

Changelog:

- Now autodetects router model, meaning you do not need to manually enter your router model for the install and update commands anymore
- Added to /opt/bin to now be able to run commands simply by entering "cake-qos install" for example, instead of "/jffs/scripts/cake-qos install"
- Now binds to nat-start
- Added MD5 check to update as an additional check for any script updates
- Added more intuitive log messages

And as @ttgapers mentioned, @Jack Yaz, @Martineau and @rgnldo have also contributed to this.

I'd also like to call this the @maghuro release, as his contributions to this version has been invaluable. Welcome to the team!
 
That would be a cool script to use the data collected by YazFi's spdMerlin to make on the fly adjustments for cakeQoS.
yeah, my comcast upload speed goes from 5Mbps during work hours to 20Mbps outside work hours. it's great! :-/
 
yeah, my comcast upload speed goes from 5Mbps during work hours to 20Mbps outside work hours. it's great! :-/

Damn, that's some rough swings. might be better to schedule via cru two tasks with the enable command based on your speed changes.....
 
Possibly a bit early for this one, but has anyone looked at the Shaper Parameters?

SHAPER PARAMETERS
CAKE uses a deficit-mode shaper, which does not exhibit the initial
burst typical of token-bucket shapers. It will automatically burst
precisely as much as required to maintain the configured throughput.
As such, it is very straightforward to configure.

unlimited (default)
No limit on the bandwidth.

bandwidth RATE
Set the shaper bandwidth. See tc(8) or examples below for
details of the RATE value.

autorate-ingress
Automatic capacity estimation based on traffic arriving at this
qdisc. This is most likely to be useful with cellular links, which
tend to change quality randomly. A bandwidth parameter can be used
in conjunction to specify an initial estimate. The shaper will
periodically be set to a bandwidth slightly below the estimated rate.
This estimator cannot estimate the bandwidth of links downstream of
itself.

I wonder if autorate-ingress or unlimited could help people with either higher speed connections over the normal recommended values or those with variable connections.

I'm full of stupid ideas, but not the development skills to follow through.
 
Possibly a bit early for this one, but has anyone looked at the Shaper Parameters?



I wonder if autorate-ingress or unlimited could help people with either higher speed connections over the normal recommended values or those with variable connections.

I'm full of stupid ideas, but not the development skills to follow through.

I haven't personally looked into those as of yet. Playing around with besteffort vs diffserv3/4/8 right now. Interested to see what your results are should you decide to test.
 
Possibly a bit early for this one, but has anyone looked at the Shaper Parameters?



I wonder if autorate-ingress or unlimited could help people with either higher speed connections over the normal recommended values or those with variable connections.

I'm full of stupid ideas, but not the development skills to follow through.

how does one apply autorate-ingress? with cake-qos enable?
 
This works extremely well. On an NBN FTTC 100/40 connection.
Code:
cake-qos enable 100Mbit 40Mbit "overhead 22 ptm diffserv8 triple-isolate nat"


No QOS. Guess where I turned QOS on.;)
turnon.png


QOS download using the above parameters. Initial spike as the download begins.
cakeqos.png


QOS upload.
upload-40.png


Without QOS I get a consistent 99Mbps, with QOS I get a consistent 95-96Mbps. With FreshJR I would be limited to 88Mbps with the same initial spike in response time, and an overall higher jitter rate (not much, but still).

I'll try playing with the parameters some more later and see if I can squeeze a little more download speed.

My only nitpick is on the upload. With FreshJR I would get a constant 38-39Mbps. It was a literal flat line, with cake-qos there is some inconsistency with the upload speed. Even if I further rate limit it to 30Mbps.
upload.png


Our National Broadband Network here has a very strict policer which generates results similar to that shown above. There's not many dropped packets on the upload compared to the download.
Code:
tc -s qdisc show dev eth0
qdisc cake 801b: root refcnt 2 bandwidth 40Mbit diffserv8 triple-isolate nat nowash no-ack-filter split-gso rtt 100.0ms ptm overhead 22 no-sce
 Sent 693034977 bytes 762576 pkt (dropped 54, overlimits 533477 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 409728b of 4Mb
 capacity estimate: 40Mbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       51 /    1546
 average network hdr offset:           14

                  Tin 0        Tin 1        Tin 2        Tin 3        Tin 4        Tin 5        Tin 6        Tin 7
  thresh         40Mbit       35Mbit    30625Kbit    26796Kbit    23447Kbit    20516Kbit    17951Kbit    15707Kbit
  target          5.0ms        5.0ms        5.0ms        5.0ms        5.0ms        5.0ms        5.0ms        5.0ms
  interval      100.0ms      100.0ms      100.0ms      100.0ms      100.0ms      100.0ms      100.0ms      100.0ms
  pk_delay          0us          0us        2.7ms          0us          0us          0us          0us          1us
  av_delay          0us          0us        766us          0us          0us          0us          0us          0us
  sp_delay          0us          0us         20us          0us          0us          0us          0us          0us
  backlog            0b           0b           0b           0b           0b           0b           0b           0b
  pkts                0            0       762627            0            0            0            0            3
  bytes               0            0    693112607            0            0            0            0          126
  way_inds            0            0         3689            0            0            0            0            0
  way_miss            0            0         1110            0            0            0            0            1
  way_cols            0            0            0            0            0            0            0            0
  marks               0            0            0            0            0            0            0            0
  drops               0            0           54            0            0            0            0            0
  ack_drop            0            0            0            0            0            0            0            0
  sp_flows            0            0            1            0            0            0            0            1
  bk_flows            0            0            1            0            0            0            0            0
  un_flows            0            0            0            0            0            0            0            0
  max_len             0            0         1514            0            0            0            0           42
  quantum          1220         1068          934          817          715          626          547          479

Code:
tc -s qdisc show dev ifb9eth0
qdisc cake 801c: root refcnt 2 bandwidth 100Mbit diffserv8 triple-isolate nat wash ingress no-ack-filter split-gso rtt 100.0ms ptm overhead 22 no-sce
 Sent 951225412 bytes 848990 pkt (dropped 11781, overlimits 664355 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 316Kb of 5000000b
 capacity estimate: 100Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       70 /    1546
 average network hdr offset:           14

                  Tin 0        Tin 1        Tin 2        Tin 3        Tin 4        Tin 5        Tin 6        Tin 7
  thresh        100Mbit    87500Kbit    76562Kbit    66992Kbit    58618Kbit    51290Kbit    44879Kbit    39269Kbit
  target          5.0ms        5.0ms        5.0ms        5.0ms        5.0ms        5.0ms        5.0ms        5.0ms
  interval      100.0ms      100.0ms      100.0ms      100.0ms      100.0ms      100.0ms      100.0ms      100.0ms
  pk_delay          0us          0us        5.0ms          0us          0us          0us          0us          3us
  av_delay          0us          0us        4.1ms          0us          0us          0us          0us          0us
  sp_delay          0us          0us          3us          0us          0us          0us          0us          0us
  backlog            0b           0b           0b           0b           0b           0b           0b           0b
  pkts                0            0       860765            0            0            0            0            6
  bytes               0            0    968707689            0            0            0            0          438
  way_inds            0            0         1791            0            0            0            0            0
  way_miss            0            0         1271            0            0            0            0            2
  way_cols            0            0            0            0            0            0            0            0
  marks               0            0            0            0            0            0            0            0
  drops               0            0        11781            0            0            0            0            0
  ack_drop            0            0            0            0            0            0            0            0
  sp_flows            0            0            3            0            0            0            0            1
  bk_flows            0            0            1            0            0            0            0            0
  un_flows            0            0            0            0            0            0            0            0
  max_len             0            0         1514            0            0            0            0           86
  quantum          1514         1514         1514         1514         1514         1514         1369         1198
 
how does one apply autorate-ingress? with cake-qos enable?

https://man7.org/linux/man-pages/man8/tc-cake.8.html
SHAPER PARAMETERS

autorate-ingress
Automatic capacity estimation based on traffic arriving at this
qdisc. This is most likely to be useful with cellular links, which
tend to change quality randomly. A bandwidth parameter can be used
in conjunction to specify an initial estimate. The shaper will
periodically be set to a bandwidth slightly below the estimated rate.
This estimator cannot estimate the bandwidth of links downstream of
itself.

cake-qos enable xxmbit xxmbit "autorate-ingress (plus other options)"
 
This recently noticed problem with the upload queue dropping cake got me to thinking.

Would it be possible to allow the user to configure cake such that cake is only applied to the upload queue?

I figure this would be useful to those of you with high speed Gigabit download speeds. Since the router doesn't have enough grunt to handle speeds above 300Mbps, would it be useful to simply disable cake on the download queue. That would work wouldn't it? Download links faster than 300Mbps are going to benefit less from cake anyway, and those user can still enjoy the benefits of cake when the upload link is saturated.

Perhaps allow the bandwidth parameters to be specified as "0Mbit" which the script will interpret as a command to disable cake on that upload/download interface?
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top