Skip to content

Commit

Permalink
README.md: added a couple of tuning tips
Browse files Browse the repository at this point in the history
  • Loading branch information
rickkatquanzadotnet committed Mar 20, 2023
1 parent 8c2cd9b commit bf905d8
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Currently only supports nssfq-codel and no traffic classification / marking due

If you're building OpenWRT yourself, you can add this script to your build with a feed:

echo "src-git sqm_scripts_nss https://github.com/rickkdotnet/sqm-scripts-nss.git >> feeds.conf
echo "src-git sqm_scripts_nss https://github.com/rickkdotnet/sqm-scripts-nss.git" >> feeds.conf
./scripts/feeds update
./scripts/feeds install sqm-scripts-nss

Expand Down Expand Up @@ -67,16 +67,30 @@ If it's working the output from tc should look something like this:
maxpacket 1518 drop_overlimit 0 new_flow_count 5081 ecn_mark 0
new_flows_len 0 old_flows_len 1

## Known bugs, limitations
## Configuration notes

* DO try lowering the codel interval to the worst-case latency of the internet services you frequently use. This make codel more aggressive/quicker to react. I use "interval 50ms" in the advanced options string
* DO try lowering the codel target a little if you're on a low latency connection, it could shave off another ms or so.
* DO try adding "quantum 304" to the advanced options string for the lowest latency for games, voip etc. This essentially gives <304 bytes packets a 5x higher priority than 1518 packets to get dequeued.
* DON'T set the queue size so small that you have taildropping (drop_overlimit counter in tc -s increasing), as this causes significant bufferbloat in the first few seconds of a speedtest (try pinging with a short interval while starting your test). Popular opinion is that 1000 packets should be enough for gigabit, but I needed more than 2000 packets on my 350 Mb/s nssifb interface. This might be a quirk of NSS/nssifb.
* DO your own testing and draw up your own conclusions. First there's a lot of hear-say on the internet, and second your situation might very well be different.

FYI, as of March 2023, my tc config looks like this:

qdisc nsstbl 1: dev eth0 root refcnt 2 buffer/maxburst 4554b rate 37Mbit mtu 1518b accel_mode 0
qdisc nssfq_codel 10: dev eth0 parent 1: target 3.5ms limit 304p interval 50ms flows 1024 quantum 304 set_default accel_mode 0```
qdisc nsstbl 1: dev nssifb root refcnt 2 buffer/maxburst 45540b rate 360Mbit mtu 1518b accel_mode 0
qdisc nssfq_codel 10: dev nssifb parent 1: target 3.5ms limit 2964p interval 50ms flows 1024 quantum 304 set_default accel_mode 0

## Known bugs, limitations

* Due to limitations of the driver:
* Only fq-codel is supported as a queue discipline
* No marking or traffic classification is currently possible, this also means that DSCP squashing does not work
* ECN marking is not supported
* The script does not does anything with the Link Layer Adaptation fields.
* On kernel 5.10 the script does not remove the nssifb interface if it's stopped, because removing or even bringing down the interface frequently crashed my router. This could cause problems if you're switching to a script which set up regular ifb4ethX interfaces. You probably need to reboot if you want to switch to another SQM script.
# On kernel 5.15 the above problem has been resolved, but in some cases (I think under high load), the router crashes on ip link up of nssifb, *especially* when called from hotplug. Because of this, there's workaround in the script that prevents the script from executing when it's called from hotplug.
* On kernel 5.15 the above problem has been resolved, but in some cases (I think under high load), the router crashes on ip link up of nssifb, *especially* when called from hotplug. Because of this, there's workaround in the script that prevents the script from executing when it's called from hotplug.



Expand Down

1 comment on commit bf905d8

@jxph1123
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking forward to more improvement.

Please sign in to comment.