Help me figure out why I have gaming latency

What element brings this stability?

Stable frame rate:
PC:
A CPU that's fast enough to not bottleneck your GPU, under any circumstance.
A GPU that's comfortably below it's performance limit - so all in-game graphics settings at low, 1080p monitor (1440p maybe, depending on the capabilities of your GPU, 4K certainly not for another couple of years) with variable refresh rate and the game's refresh rate limited at either ~4pfs below the monitors max. refresh rate or a little below the max. the GPU can put out ~98% of the time. If there is no frame rate limit setting in-game, the driver software is fine as well.
I second Nvidia-Reflex if the game supports it (and you have an Nvidia GPU of course).

Console:
Afaik there is nothing you can change.

1 Like

@segal_72 would you be willing to run cake-autorate with cake set to 10Mbit/s upload and download and cake changes disabled and then run for 24 hours so we can see what happens to RTT and whether there are ping spikes over a 24 hour period? You can choose a mix of reflectors like 1.1.1.1 and your game server IPs.

reflectors=("1.1.1.1" "1.0.0.1" "8.8.8.8" "8.8.4.4" "9.9.9.9" "9.9.9.10")
no_pingers=4
# Set either of the below to 0 to adjust one direction only 
# or alternatively set both to 0 to simply use cake-autorate to monitor a connection
adjust_dl_shaper_rate=1 # enable (1) or disable (0) actually changing the dl shaper rate
adjust_ul_shaper_rate=1 # enable (1) or disable (0) actually changing the ul shaper rate
# ** Take care with these settings to ensure you won't run into OOM issues on your router ***
# every write the cumulative write time and bytes associated with each log line are checked
# and if either exceeds the configured values below, the log log file is rotated
log_to_file=1             # enable (1) or disable (0) output logging to file (/tmp/cake-autorate.log)
log_file_max_time_mins=1380 # maximum time between log file rotations
log_file_max_size_KB=10000000 # maximum KB (i.e. bytes/1024) worth of log lines between log file rotations

You should perhaps log to a USB stick rather than /tmp in your router by changing this line:

Alternatively you could just have this running in the background as a flight recorder to verify that when you actually encounter lag there are no RTT spikes for that same period.

So, in other words:

  • setup cake-autorate with default logging (this will log rotate more regularly) but disable cake changes and set your cake bandwidth to 10MBit/s
  • play you game
  • if you encounter lag in your game then note the time
  • then export cake log file
  • check whether cake-autorate recorded ping spikes for the same time period (everything is timestamped).

@moeller0 what do you think? It may be an idea to enable specifying the log output path(?), albeit we do already facilitate custom log file export location so there is an interaction there that I am not sure about.

1 Like

Sounds like a decent plan, try to add a ping target close to the game servers/from the game company....

Check CakeConnoisseur's comment. Drop down your PC specs -
Go to windows search, type: dxdiag
It'll open DirectX Diagnostic Tool with system specs. Show screenshots of both 'System' & 'Display' panels. I'll try help you get stable FPS.
Just so you know this is not related to OpenWrt subject anymore. But for future reference it'll help people like you.

@CakeConnoisseur @Lynx @dlakelan
Thank you for your response and your commitment to me . I will install all this on my own and configure it and come back to you!

Looking at MW2 release, and people that join game right now changing their location in callofduty profile to New Zealand, could you check which location you have in callofduty website? They all lagging right now because of this location change.
BR

He said he's lagging in all the games not just COD.

I pushed a commit recently on cake-autorate to customize log file location. So now you can log out to a USB stick and set a huge log file size / time. So I really think that @segal_72 you should set this up to consult log file lines with timestamps corresponding with the times you noticed lag during one of your gaming sessions and see what happens with the RTTs to your selection of reflectors including gaming servers.

Thank you, I tried to install your script but I have to insert values but it's not clear to me... I expect to put its values behind an =, or behind 2 *... there is text and I do not know if to delete it to enter my bandwidth rates... for a noob like me it lacks clarity without offending you...

So cake-autorate_config.sh is the file that contains all configuration variables.
It is written in bash so bash rules apply. Most importantly bash uses significant whitespace so to assign the string 'value' to a variable named 'name' you need to write name=value with no spaces around the equality sign. The other important thing to know is, bash will treat everything in a line after a # as comment and ignore it.

So essentially you just nedd to edit cake-autorate_config.sh and replace those values that you want to change. For example you likely need to change the interfaces:

dl_if=ifb-dl # download interface
ul_if=ifb-ul # upload interface

these names should match your sqm/cake config. For pppoe that would be:

dl_if=ifb4pppoe-wan # download interface
ul_if=pppoe-wan # upload interface

Hope that helps....

1 Like

Ok thank you.. so

Si for me i have wan / br-lan

dl_if=wan # download interface
ul_if=br-lan# upload interface

Correct ?

I would guess that your egress shaper on br-lan handles your internet downloads while wan egress handles you internet uploads. That in turn would mean:

dl_if=br-lan # download interface
ul_if=wan# upload interface

but this depends a bit on your sqm details, maybe post the output of:

  1. ifstatus wan
  2. cat /etc/config/sqm
  3. tc -s qdisc

that should help confirming the interfaces.

I'm checking all of this ,after work, and I'll get back to you later. Thanks for your answer!

root@CakeAutoRate:~# ifstatus wan
{
        "up": true,
        "pending": false,
        "available": true,
        "autostart": true,
        "dynamic": false,
        "uptime": 115,
        "l3_device": "wan",
        "proto": "dhcp",
        "device": "wan",
        "updated": [
                "addresses",
                "routes",
                "data"
        ],
        "metric": 0,
        "dns_metric": 0,
        "delegation": false,
        "ipv4-address": [
                {
                        "address": "x.x.x.x.x",
                        "mask": 16
                }
        ],
        "ipv6-address": [

        ],
        "ipv6-prefix": [

        ],
        "ipv6-prefix-assignment": [

        ],
        "route": [
                {
                        "target": "0.0.0.0",
                        "mask": 0,
                        "nexthop": "x.x.x.x.x",
                        "source": "x.x.x.x.x/32"
                }
        ],
        "dns-server": [
                "x.x.x.x.",
                "x.x.x.x"
        ],
        "dns-search": [

        ],
        "neighbors": [

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

                ],
                "ipv6-address": [

                ],
                "route": [

                ],
                "dns-server": [

                ],
                "dns-search": [

                ],
                "neighbors": [

                ]
        },
        "data": {
                "dhcpserver": "192.168.8.1",
                "leasetime": 86400
        }
}






root@CakeAutoRate:~# cat /etc/config/sqm

config queue 'eth1'
        option qdisc 'cake'
        option script 'piece_of_cake.qos'
        option enabled '1'
        option interface 'wan'
        option debug_logging '0'
        option verbosity '5'
        option linklayer 'ethernet'
        option overhead '34'
        option download '10000'
        option upload '10000'


root@CakeAutoRate:~# 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 fq_codel 0: dev eth0 root refcnt 2 limit 10240p flows 1024 quantum 1518 target 5ms interval 100ms memory_limit 4Mb ecn drop_batch 64
 Sent 24044119 bytes 37583 pkt (dropped 0, overlimits 0 requeues 3)
 backlog 0b 0p requeues 3
  maxpacket 1446 drop_overlimit 0 new_flow_count 4 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc noqueue 0: dev lan1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev lan2 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev lan3 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev lan4 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 800c: dev wan root refcnt 2 bandwidth 5Mbit besteffort triple-isolate nonat nowash no-ack-filter split-gso rtt 100ms noatm overhead 34
 Sent 2355795 bytes 19256 pkt (dropped 3, overlimits 3920 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 51488b of 4Mb
 capacity estimate: 10Mbit
 min/max network layer size:           28 /    1434
 min/max overhead-adjusted size:       62 /    1468
 average network hdr offset:           14

                  Tin 0
  thresh          5Mbit
  target            5ms
  interval        100ms
  pk_delay       1.87ms
  av_delay        234us
  sp_delay          5us
  backlog            0b
  pkts            19259
  bytes         2359983
  way_inds          239
  way_miss         1074
  way_cols            0
  drops               3
  marks               0
  ack_drop            0
  sp_flows            5
  bk_flows            1
  un_flows            0
  max_len         26064
  quantum           300

qdisc ingress ffff: dev wan parent ffff:fff1 ----------------
 Sent 20365536 bytes 19531 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 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 cake 800d: dev ifb4wan root refcnt 2 bandwidth 10Mbit besteffort triple-isolate nonat wash no-ack-filter split-gso rtt 100ms noatm overhead 34
 Sent 20816848 bytes 19482 pkt (dropped 49, overlimits 23329 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 320236b of 4Mb
 capacity estimate: 10Mbit
 min/max network layer size:           46 /    1434
 min/max overhead-adjusted size:       80 /    1468
 average network hdr offset:           14

                  Tin 0
  thresh         10Mbit
  target            5ms
  interval        100ms
  pk_delay       19.3ms
  av_delay       3.34ms
  sp_delay         12us
  backlog            0b
  pkts            19531
  bytes        20882374
  way_inds          150
  way_miss          299
  way_cols            0
  drops              49
  marks               0
  ack_drop            0
  sp_flows            0
  bk_flows            1
  un_flows            0
  max_len         17304
  quantum           305

root@CakeAutoRate:~#

My config : 5G router in bridge mode to OpenWrt router in Dhcp . Sqm cake pce cake 10/10 .

With this settings i loose internet

dl_if=br-lan # download interface
ul_if=wan# upload interface

Normally I put wan for download and br-lan for upload, but with this script nothing works !

According to your information You should change

to

dl_if=Ifb4lan # download interface

as that interface handles your internet download traffic.

That seems to be off, as wan by itself (that is without and ifb) can not actually deal with ingress traffic, so can natively only handle internet upload, and vice versa for br-lan. For a pure SQM set-up with the same rate setting for both directions (as in your /etc/config/sqm above) things will not matter that much, but for autorate it might matter more (as autorate will not be able to control the shaper and potentially pick the wrong rate fron the interface).
That said, autorate should also work with wan set up to shape upload traffic and br-lan set up to shape download traffic (so without an ifb) but the underlaying SQM configuration needs to be correct.

So as a rule of thumb since cake-autprate does not set-up cake instances in the first place, you first configure sqm, then use tc -s qdisc to figure out which two interfaces are having a cake instance and then plug these into cake-autorate_config.sh. Getting the direction correct is going to be essential. I would probably start out with setting all three rates equally per direction (essentially disabling autorate) but different between directions, say 10 Mbps for download and 5 Mbps for upload (making sure that the high rate still is lower than the slowest direction of the link) and then run speedtests, if you set upload 5 download 10, and the speedtest confirms this 10/5 you got configured dl_if and ul_if correctly, if the speedtest gives you 5/10 then you need to flip the labels....

Did you make any progress on this @segal_72?