Questions about SQM settings


I had sqm configured in the past but the latest release to my router (Netgear R7800) made me to make some mistakes and I end up hitting the router reset button (yes, I know now I could have used failsafe an etc, but I didn't).

So, now, when I reinstalled sqm packages sqm-scripts and sqm-scripts-extra I got a new config file which is different from the one I had before (I saved a backup of all files in /etc/config and /.ssh.

My home setup is the ISP ONT -> my router -> all other home devices

So, the original config is this:

config queue 'eth1'
        option enabled '0'
        option interface 'eth1'
        option download '85000'
        option upload '10000'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'
        option qdisc_advanced '0'
        option ingress_ecn 'ECN'
        option egress_ecn 'ECN'
        option qdisc_really_really_advanced '0'
        option itarget 'auto'
        option etarget 'auto'
        option linklayer 'none'

config queue 'wan'
        option debug_logging '1'
        option verbosity '5'
        option squash_dscp '1'
        option squash_ingress '1'
        option ingress_ecn 'ECN'
        option egress_ecn 'NOECN'
        option interface 'eth0.12'
        option download '180000'
        option upload '90000'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'
        option qdisc_advanced '1'
        option qdisc_really_really_advanced '0'
        option itarget 'auto'
        option etarget 'auto'
        option enabled '1'
        option linklayer 'ethernet'
        option overhead '44'

Where the eth1 section was what came by default when I installed sqm packages and wan section was the only section I had before the update and before things went south!

When I restarted sqm with /etc/init.d/sqm restart I got this:

~# /etc/init.d/sqm restart
SQM: Stopping SQM on eth0.12
SQM: Starting SQM script: piece_of_cake.qos on eth0.12, in: 180000 Kbps, out: 90000 Kbps
SQM: piece_of_cake.qos was started on eth0.12 successfully

So, it says there that SQM was restarted for eth0.12. But the config file refers no eth0.12. Is this fine?

This is part of my /etc/config/network file:

config interface 'lan'
        option proto 'static'
        option ipaddr ''
        option netmask ''
        option ip6assign '60'         
        option device 'br-lan'
config interface 'wan'
        option proto 'dhcp'
        option peerdns '0' 
        list dns ''
        list dns ''
        option device 'eth0.12'
config interface 'wan6'
        option proto 'dhcpv6'
        option peerdns '0'   
        list dns '2606:4700:4700::1111'
        list dns '2606:4700:4700::1001'
        option device 'eth0.12'

Other question I have is if for an internet nominal speed of 200Mbit/s downstream and 100Mbit/s upstream, what values should I use? Or hos should I configure this?

This is from your /etc/config/sqm so eth0.12 seems to be requested by your config file.

The quickest way is to disable SQM, run a few speedtests you trust, get the consensus throughput value for upload and download, and put these numbers directly as gross shaper rates for SQM. Then test whether latency under load stays acceptable, if yes you are done, if not start reducing download by 10 and upload by increments of 5 Mbps until you hit limits for both directions with acceptable performance.

Ohh, I missed that line in section wan of my config file, but I can't see anything for the eth1 section!

About the speeds, what I did what 10% less of the ISP nominal speeds! Not sure this is the best option.
At this point, I have a few services running that I cannot stop for now, for the sake of testing using the method you mentioned. Maybe uring the weeked I can stop te services for a while for testing!

This will work if you reliably get your contracted speed. But to figure that out you need speedtest results and once you have those you can mostly ignore the contracted rate as far as sqm/traffic shaping is concerned :wink:

I have been trying to peform a speed test at but my Firefox keeps refusing to connect to wss:// (firefox consol message) and after this I see several error messages referring to CORS.

I have already tried to disable all add-ons (noScript, addblock, uBlock Origin, StartPage Privacy) but I still get the same response from Firefox.
Anyone have a clue on what is going on? I'm on Debian Buster and using Firefox with quite a few mods/configs and also a custom user.js file for privacy enhancement.

Could it be due to any of these settings somehow blocking the site from performing the speedtest?

I have used this guide

and also, I'm using a user.js file with additional settings.

I just stopped sqm script and I got better results, still very bad. I have to say I tried in another computer and also tried another site other than dslreports and results kinda match on both sites but for a hired speed of 500Mbps / 100Mbps, it is still very bad in terms of dowlonad speed.
I'm getting around 170Mbps / 113Mbps with sqm turned off. With it turned on, speeds are even lower.
I set 450000 and 90000 (10% below rated speeds) in sqm.


Do we have to restart network or just sqmafter changing any setting insidesqm` configs?

Try the Waveform test -

Just tried.
On my laptop, no sqm, Firefox modded, I get
206Mbps / 115Mbps

Second attempt
206Mbps / 111Mbps
no bufferbloat grade, probably due to firefox modds.

On my daughter laptop, which is much weaaker (school offered computer)
I got even worse:
65Mbps / 96.9Mbps
but A for bufferbloat grade.

Tried a second time just for the sake of any possible hick up!
79Mbps / 100.5Mbps
Grade A again

Results on my daughter laptop are not even consistent with the other 2 sites I tried!
And again, this is with sqpstopped!

Are you testing on a wired connection, or wireless?

Wireless for now! And I also have other equipments using the internet, but still, from 500Mbps to like 200Mbps, can't be from the other equipments connected alone!

And why with sqm activated, speeds are even lower??
Once more, do we need to restart network after any config change in sqm ?

Note: I didn't install luci-sqm-app. Only the scripts and scripts-extra packages!

Another note;
I can download pretty well with rtorrent. I got speeds of 56Mb/s with sqm stopped...

You should be testing wired.

Your speed issues are probably related to wireless issues.

SQM has some're trading off some speed for the benefits.

I personally went from using Cake/Piece of Cake, to fq_codel/simplest.qos, to no SQM...which works for our use cases.

Save & Apply after making changes in SQM is sufficient...I don't restart.

Yes, but I can get the expected speed when downloading from rtorrent (wireless too).
Can't see why speeds works fine with rtorrent and not with speedtests.

You simply don't use SQM?

I can confirm that with SQM stopped, rtorrent speeds are way better! At least Download speed is like twice as fast! :woozy_face: :woozy_face:

I always run /etc/init.d/sqm restart

How are you measuring that speed?

Not anymore.

That's fine.

What exactly is your advertised speed (what you're paying for)?

All these answers are in my posts above but I'll put them all here:

rtorrent download rate

Even more than the hired speed.

The 500Mbps I mentioned here is the hired speed (the one I'm paying for).

Mb/s is megabits per second...MB/s is megabytes per second.

So it's actually worse than the rate on your daughter's laptop (65 Mbps and 79 Mbps posted above).

rtorrent says 56326.3 KB... I wrote it wrongly. I assume this is 56MB/s.

That's fine.

So torrents work differently...the more peers, the more speed.

I'm not a torrent person, but I'm sure others here will chime in on the subject.

Keep in mind that running torrents will affect the speeds of other clients on the network, so I would do "normal" speed testing with no torrents running, and on a wired connection, when the network is quiet...meaning no one else is on except you.

I would do the following...

Make sure you are configuring SQM for the correct interface.

In SQM, start with 490000 for ingress and 95000 for egress (500/100 advertised speed), use Cake/Piece of Cake, and Per Packet overhead of 34.

No custom settings.

Run a couple of wired speed tests.

Then, change ingress to zero, and test.

Next, change to fq_codel and simplest.qos

Test with ingress still at zero, and then again at 490000.

Then, turn off SQM, go to Network > Firewall > Routing/NAT Offloading section.

Check the Software flow offloading box.

When you do, you'll see the Hardware flow offloading box.

Leave that unchecked, as hardware NAT is only supported on MT7621 devices.

You can post the links to your Waveform test results.

I think the next thing to look at is your wireless configs.

But until you get wired dialed in, that will need to wait.

I didn't run the speed tests while downloading torrents. Speed tests were performed with torrent downloads stopped!

500Mbps / 100Mbps is the hired Inernet speed.
If I understand correctly, this would mean a top download speed of 500*0.125 = 62.5MB/s.
rtorrent registered around 56Mb/s. If I consider that other devices, IPTV were using the internet simultaneously, I would take this value as a very good value wrt the hired speed!

About the settings you tell me to try, I think you're assuming I'm using Luci... I'm not. I said earlier that I only installed 2 sqm packages: sqm-scripts and sqm-scripts-extra. I never installed luci-sqm-app.

I'll be back to this tomorrow! Sleep time now!
thanks for replying and helping

LuCI is not "required"...but it makes it easier to configure OpenWrt settings IMO.

Changed the test numbers in the post above.

So you seem to have two issues:
a) sqm if/howto use
b) WiFi

WiFi tends to be its own can of worms, so I would recommend to address these issues one by one....

Personally I have more experience with sqm than wifi, so can only offer to help with a).

If you are interested please post the following pieces of information:
0) PLEASE IGNORE:your router model and brand, Netgeat R7800, from the first post, thanks @anon89577378

  1. your ISP and access technology
  2. the output of:
    a) cat /etc/config/sqm
    b) ifstatus wan | grep -e device
    c) tc -s qdisc

Then we can take it from there....

Looks like that was included in the first post...

1 Like