Help with optimizing my setup for best possible performance in gaming and decrease latency

This my setup:

BusyBox v1.28.4 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 18.06.4, r7808-ef686b7292
 -----------------------------------------------------
root@OpenWrt:~# cat /etc/config/sqm

config queue 'eth1'
        option enabled '1'
        option debug_logging '0'
        option qdisc 'cake'
        option interface 'eth0.2'
        option download '170000'
        option upload '29750'
        option verbosity '0'
        option qdisc_advanced '0'
        option script 'test_WAN_triple-isolate__piece_of
_cake.qos'
        option linklayer 'ethernet'
        option overhead '44'

root@OpenWrt:~# 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 536335044 bytes 1677866 pkt (dropped 0, overlimits
 0 requeues 8)
 backlog 0b 0p requeues 8
qdisc fq_codel 0: dev eth0 parent :1 limit 10240p flows 
1024 quantum 1514 target 5.0ms interval 100.0ms memory_l
imit 4Mb ecn
 Sent 536335044 bytes 1677866 pkt (dropped 0, overlimits
 0 requeues 8)
 backlog 0b 0p requeues 8
  maxpacket 1448 drop_overlimit 0 new_flow_count 10 ecn_
mark 0
  new_flows_len 0 old_flows_len 0
qdisc mq 0: dev eth1 root
 Sent 792878954 bytes 1234298 pkt (dropped 5, overlimits
 0 requeues 32)
 backlog 0b 0p requeues 32
qdisc fq_codel 0: dev eth1 parent :1 limit 10240p flows 
1024 quantum 1514 target 5.0ms interval 100.0ms memory_l
imit 4Mb ecn
 Sent 792878954 bytes 1234298 pkt (dropped 5, overlimits
 0 requeues 32)
 backlog 0b 0p requeues 32
  maxpacket 1514 drop_overlimit 0 new_flow_count 17 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.1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)

 backlog 0b 0p requeues 0
qdisc cake 8004: dev eth0.2 root refcnt 2 bandwidth 2975
0Kbit besteffort triple-isolate nonat nowash no-ack-filt
er split-gso rtt 100.0ms noatm overhead 44
 Sent 536332750 bytes 1677850 pkt (dropped 5307, overlim
its 220164 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 645248b of 4Mb
 capacity estimate: 29750Kbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       72 /    1544
 average network hdr offset:           14

                  Tin 0
  thresh      29750Kbit
  target          5.0ms
  interval      100.0ms
  pk_delay        4.0ms
  av_delay        247us
  sp_delay          3us
  backlog            0b
  pkts          1683157
  bytes       544013359
  way_inds         1765
  way_miss        12689
  way_cols            0
  drops            5307
  marks               0
  ack_drop            0
  sp_flows            1
  bk_flows            1
  un_flows            0
  max_len         30280
  quantum           907

qdisc ingress ffff: dev eth0.2 parent ffff:fff1 --------
--------
 Sent 1489279182 bytes 2490796 pkt (dropped 0, overlimit
s 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev wlan1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)

 backlog 0b 0p requeues 0
qdisc cake 8005: dev ifb4eth0.2 root refcnt 2 bandwidth 
170Mbit besteffort triple-isolate nonat nowash no-ack-fi
lter split-gso rtt 100.0ms noatm overhead 44
 Sent 1533207470 bytes 2490793 pkt (dropped 3, overlimit
s 329473 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 68Kb of 8500000b
 capacity estimate: 170Mbit
 min/max network layer size:           46 /    1500
 min/max overhead-adjusted size:       90 /    1544
 average network hdr offset:           14

                  Tin 0
  thresh        170Mbit
  target          5.0ms
  interval      100.0ms
  pk_delay         23us
  av_delay          7us
  sp_delay          1us
  backlog            0b
  pkts          2490796
  bytes      1533211890
  way_inds         2043
  way_miss        12566
  way_cols            0
  drops               3
  marks               0
  ack_drop            0
  sp_flows            0
  bk_flows            1
  un_flows            0
  max_len         12112
  quantum          1514

root@OpenWrt:~# ifstatus wan
{
        "up": true,
        "pending": false,
        "available": true,
        "autostart": true,
        "dynamic": false,
        "uptime": 89616,
        "l3_device": "eth0.2",
        "proto": "dhcp",
        "device": "eth0.2",
        "metric": 0,
        "dns_metric": 0,
        "delegation": true,
        "ipv4-address": [
                {
                        "address": "47.16.210.245",
                        "mask": 22
                }
        ],
        "ipv6-address": [

        ],
        "ipv6-prefix": [

        ],
        "ipv6-prefix-assignment": [

        ],
        "route": [
                {
                        "target": "0.0.0.0",
                        "mask": 0,
                        "nexthop": "47.16.208.1",
                        "source": "47.16.210.245\/32"
                }
        ],
        "dns-server": [
                "167.206.10.178",
                "167.206.10.179"
        ],
        "dns-search": [

        ],
        "inactive": {
                "ipv4-address": [

                ],
                "ipv6-address": [

                ],
                "route": [

                ],
                "dns-server": [

                ],
                "dns-search": [

                ]
        },
        "data": {
                "leasetime": 21600
        }
}


« SpeedGuide.net TCP Analyzer Results » 
Tested on: 2019.08.28 11:44 
IP address: 47.16.xxx.xxx 
Client OS/browser: Windows 10 (Chrome 70.0.3538.102) 
 
TCP options string: 020405b40103030801010402 
MSS: 1460 
MTU: 1500 
TCP Window: 262144 (not multiple of MSS) 
RWIN Scaling: 8 bits (2^8=256) 
Unscaled RWIN : 1024 
Recommended RWINs: 64240, 128480, 256960, 513920, 1027840 
BDP limit (200ms): 10486kbps (1311KBytes/s)
BDP limit (500ms): 4194kbps (524KBytes/s) 
MTU Discovery: ON 
TTL: 115 
Timestamps: OFF 
SACKs: ON 
IP ToS: 00000000 (0)

My dslreport with sqm disabled:

With sqm enabled:

It looks like you are on a cable/docsis network that does not use ds-lite (as seen from the MSS 1460 value in the speedguidenet results). So for all we know your overhead is 18 bytes (and with some bad luck 22 if your ISP uses a VLAN), so reducing that sounds like a decent first step.

I would also add the following:

        option linklayer_advanced '1'
        option tcMTU '2047'
        option tcTSIZE '128'
        option tcMPU '64'
        option linklayer_adaptation_mechanism 'default'

This will handle the fact that on DOCSIS network we will always send ethernet frames and these are at least 64 byte in size (otherwise cake might underestimate the size of small packets leading to weird sporadic latency spikes)

I would also add:

        option iqdisc_opts 'nat dual-dsthost ingress'
        option eqdisc_opts 'nat dual-srchost'

That will first share bandwidth fairly between active devices and should help to isolate your gaming PC from other users (within reason, if say 200 users are concurrently trying to download a debian ISO image each will only get ~1Mbps, but for fewer users this typically works well).

I believe that triple-isolate is the default, so you can simply use the better maintained piece_of_cake.qos or layer_cake.qos.

These look a bit weird:
with your settings I would expected the following good-put:
170.00 * ((1500-20-20)/(1544)) = 160.75 Mbps
29.75 * ((1500-20-20)/(1544)) = 28.13 Mbps
But you only got 106.2/22.09

Since you own a r7800 router have a look at:
https://forum.openwrt.org/t/r7800-sqm-settings-keep-causing-bufferbloat/39720/9
and
https://forum.openwrt.org/t/r7800-performance/15780/51

for hints how to configure this for traffic-shaping at high rates. I do not own an r7800 and hence can not really help with the details.

As expected you selected the correct WAN interface.

The deslreports speedtests show:
a) sqm improves your uplink/egress considerable (lower average bufferbloat and less variation)
b) something seems off with the downlink/ingress as you basically only get a little more than half of what you see without sqm, and the average bufferbloat is higher with SQM active (albeit with less variability).
I believe b) is a symptom of your router's CPU being overloaded. But not because the CPU is to weak in general, more likely due to the CPU falling into powersave mode and nnot being able to react quickly enough to the variable load cake processing. The linked threads have some recommendations how to remedy this. As a first step you might want to set the download shaper rate to 0 to disable downstream shaping while you research the linked threads.

Good luck.

1 Like

Once you log into your router you can actually use an Textmode Editor in the terminal and directly edit /etc/config/sqm to change/add the option lines I gave above.
I believe BusyBox comes with a default vi editor you could use. Personaly vi is a bit too hard-core for my taste, or rather I use it to rarely to memorize it's keyboard commands.
I typically use the following command
opkg update; opkg install nano
To install the nano editor which shows the keyboard shortcuts on the bottom :wink:
nano /etc/config/sqm
Should get you started, CTRL-o will save the file, CTRL-x will exit the editor.

Hope that helps.

So when I did the nano install a bunch of stuff poped up but the after that when I tried to do the nano /etc/config/sqm it tells me nano not found?

Can u please go with step by step like I mentioned before I have 0 knowledge on terminal lol

Mmh, it looks like there is a tupo in the install command, probably my typo.

Do the first command should be:
opkg update

Followed by

opkg install nano

Please try again and copy and paste the output of each command here.
Thanks

1 Like

I don't think I could install nano it say cannot install package nano

Well too bad.
What is the output of

opkg update

This is needed to get the catalog of the remote software ressourcesvupdated/initialized, only if that succeeds will the opkg install nano command be useful.

1 Like

Disregard that
I got it to work I watched a YouTube

So I did the update and I also install nano
Now do I sign in my router then what?
Can you give it to me in steps format

What's next after installing nano?

what device are you using?
it might be to slow too do sqm@200mbps

1 Like

I'm using Xbox console if that's what u mean?

No, can you provide us the make/model of your OpenWrt device?

  • You SSH to the router and edit the config file

nano /etc/config/sqm

1 Like

I'm using an nighthawk r7800

1 Like

I believe @fuller asks for your router. I believe it is a r7800, so it should be powerful enough, albeit it might be tricky to convince it to play nicely with cake. But the first goal is to get to a good sqm configuration from which to tackle the r7800 challenges.

1 Like

Editing your /etc/config/sqm on you router to add/edit the lines as described somewhere above this post.

So I signed in my ssh and when I typed in nano it says nano not found but when I'm not signed in my ssh I could use nano... Like I need a step by step of what to do example... Open terminal..
And next do this... Next type this... Next do this... Etc I'm just getting vague answers. I'm trying guys :joy:

  1. Install nano while connected to your router
opkg update
opkg install nano
  1. Then attempt to edit /etc/config/sqm

nano /etc/config/sqm

  1. At no time do you disconnect from the router

Obviously, you only have nano installed on the computer at this time.