Getting the most out of SQM cake - my results aren't great!

My openwrt connected data rate is 35 down 7.9 up. A speed test this morning returned about 31 down, 7.2 up

I am trying to get good results from SQM Cake but I always seem to be getting jittery pings, with the occasional spike up to 250ping still (just one out of however many on waveform)

Even if I set the bandwidth limits really aggressive, such as 23000 download and 5800 upload. I am still getting really bad results:


Note: Someone else was using the internet at the time I believe, hence the speed looks bad, the connection I assume was fully saturated.

Is there anyway to improve my results further (hoping for download/upload active of 0 or 1/2...). Setting increasingly aggressive bandwidth limits doesn't seem to be helping me.

Ran another test when my home network was a bit quieter.

The headline results look great, and I'd be really pleased, but I'm getting horrible ping spikes even when the network is unloaded:

What could this be? Is it possible that the traffic of other devices aren't being shaped properly which is impacting my unloaded test?

What hardware are you using?

I use a banana pi m1 device with a dual-core a20 CPU. I recently learned it can't do SQM with cake above 150MBit, just because its CPU is not strong enough.

The thing is: Traffic shaping is CPU intensive way beyond what "routing" is, especially there's hardware offloading for routing and NAT which just does not exist for SQM.

Your numbers of course are very different from mine, but do you, by any chance, have a router that just is not powerful enough for even 15MBit when shaping the traffic?

Every time I run the waveform bufferbloat test there are a few dots at large latency. I've got a strong suspicion they are just a side effect of the way the website runs their test.

its a homehub 5 A which I believe should be plenty fast enough for my connection? I understand that SQM cake only uses 1 core. I'm not really sure how to monitor that core's CPU usage but I don't think its an issue on a hardware level from what people told me before I got it.

This does happen most of the time and I've wondered if its an issue with the website.

Pinging in command prompt to google or a dns does seem to vary slightly, but never to 200ms. About 4ms variance unloaded, loaded upload is unchanged, but loaded download the pings seem to go from 17ms to about 40ms on occasion so I'm thinking there's an issue with my download sqm specifically

The waveform test is pretty nice, but browsers, even modern browsers, are not a great environment for precision measurements, nor are they themselves rigged for low latency (so a "ping spike" might be caused by a garbage collection pass inside the browser). So as far as waveform's test is concerned your link is pretty decent. Now if you want higher precision measurement you need to switch your measurement tool. Personally I think that both flent/netperf, irtt and ipferf2 are excellent tools for higher precision measurements, but all three suffer from am absolute dearth of open public measurement servers. However you might be able to find public measurement servers for iperf3.
Or you could look at cake-autorate run what ever speedtests you like to generate load and see how this affects latency-under-load for the measurement flows.
But note that measuring in-flow versus cross-flow latency is not the same.

Nope, unfortunately these are already close to their limit with say a 50/10 link with sqm active...
I really wanted to use my HH5A as all-in-one OpenWrt router, but even at 50/10 internet access speed it did not cut it (I relegated it to serve as briged modem, where it works fine with my 116.7/37.0 Mbps VDSL2 sync, only on fully saturating bi-directional tests the throughput falls a small single digit number of Mbps short of what I expect, while the HH5A's cpu maxes out).

As a quick and dirty way, install htop on the router, log in via SSH and run htop during a speedtest while looking at the CPU usage bar (you can configure a detailed view for the CPU usage showing softinterrups in pink, do that while testing and wheep). This is not a perfect test as running ssh and htop will consume some CPU as well, but it will give you a feel how loaded your router is.
Or install luci-app-statistics and run extended tests and then look at the CPU plots which also show softirqs IIRC.

1 Like

Another way to confirm decent performance of sqm is fast.com

Once the download test is complete, click the circular arrow. It will show the loaded and unloaded latency: https://i.imgur.com/WMVB2pj.png

However, it is not exactly clear what they report, the waveform test is more helpful with its plots of all actually delay samples.

In the past the dslreports test was nice with its high-resolution bufferbloat mode, as it showed the temporal sequence of the delay samples in correct order, but alas that test has been a victim of the tooth of time and most of the formerly extensive fleet of measurement servers has become permantly off-line.

Thanks I'll try this when the internet is next relatively un-used.

Hypothetically, if I was say only 60% CPU used so I increased my download/upload rates that I've set from 23000/5800 to 26000/5800, and my CPU usage then was about 70% (random example) would my ping/bufferbloat performance be worse, even though I have CPU unused still?

p.s. will try cake autorate at some point

So cake is not that big of a sustained load (mind you, it is not cheap either) but it is pretty bursty and wants access to the CPU in a timely fashion when it needs it. So if your CPU plot averages over long enough times the reported average over the sampling interval can hide problems. Think of a use case where the CPU is maxed out at 100% for 50% of the interval and idling at 0% for the other 50%, that would be reported as an innocuous 50% cpu load, even though our bursty process of interest might already be severely CPU starved... But in general I would expect to see the CPU averages increase if you increase the shaper rate for cake and also run saturating loads. As a rule of thumb (and really not more) if during a speedtest of sufficient duration htop's CPU load stays below say 80% you are likely not (severely) CPU limited, but let me stress again this is not a "hard law" more a correlative observation, once htop's reported CPU usage during a test starts to spike above 90% however you probably are already starving cake of CPU cycles. (Again the 80 and 90% values are not magic, just the ones that correlate OK on my system with (lack of) symptoms of CPU-starvation for cake).

Great, if you have question, please pose them in the autorate thread :wink:

1 Like