Best practices and packages for gamers using OpenWrt

Hey OpenWrt community,

I'm starting this thread to open a collaborative discussion about the best practices, packages, and configurations for gamers using OpenWrt.

The goal is to gather real-world experiences and tips around:

  • Essential packages to reduce latency and improve connection stability

  • SQM/QoS optimization (Cake, fq_codel, bandwidth tuning, etc.)

  • Wi-Fi tweaks to reduce jitter and packet loss

  • Faster and more secure DNS setups (Stubby, Unbound, DoH, DoT...)

  • Hardware acceleration (Flow Offload, SFE, etc.)

  • Useful scripts or advanced tweaks that made a difference for you

Please feel free to share what you’ve done or what made a real difference in your gaming experience with OpenWrt.

Let’s help each other build a reliable set of best practices for gamers in the OpenWrt world!

Thanks!

Measure at each step.

Please post the result (link) from https://www.waveform.com/tools/bufferbloat

A NONE

B fw_codel is default, thus optimal according to you

C not possible, wifi waits for TXOP, use wired if possible, less busy channel will be somewhat better.

D indifferent for gaming

E we dont shipp SFE, flow offload works as prescribed, but disables all kinds of qdisc (qos), thus helps slow routers in general

F ethernet cable

2 Likes
  • advertised internet speed
  • ISP
  • uplink technology (*DSL, cable, FTTH, Starlink, etc ...)
  • router hw

might be relevant too.

1 Like

This.

And no Bluetooth or Wi-Fi headphones or keyboard/mouse.

(Yes and of course sqm. That's it. Last time I've done cs2 I had at max 12 ms delay :person_shrugging: )

Router Nanopi r2s

I'm using the following setup on OpenWRT:

  • QoS (qosify) with Cake scheduler:

    • Download: 75 Mbps

    • Upload: 45 Mbps

    • Overhead: 44

  • Jool is running on a dedicated interface used exclusively for Wi-Fi traffic (NAT64 setup).

  • Adblocking: using luci-app-adblock.

  • Replaced dnsmasq with dnsmasq-full (no impact on gaming performance, just better DNS handling for general browsing).

Custom sysctl.conf Parameters:

# TCP keepalive settings
net.ipv4.tcp_keepalive_time = 60
net.ipv4.tcp_keepalive_intvl = 10
net.ipv4.tcp_keepalive_probes = 3

# TCP options
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_timestamps = 0

# Conntrack tuning
net.netfilter.nf_conntrack_max = 32768
net.netfilter.nf_conntrack_buckets = 8192
net.netfilter.nf_conntrack_tcp_timeout_established = 600
net.netfilter.nf_conntrack_tcp_timeout_close_wait = 30
net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 30
net.netfilter.nf_conntrack_tcp_timeout_time_wait = 30
net.netfilter.nf_conntrack_udp_timeout = 20
net.netfilter.nf_conntrack_udp_timeout_stream = 120

net.ip4 sysctls have no bearing with forwarded traffic at all.

nanopi is on the good end. (and it does not have wifi, where you got the idea it has?)

net.netfilter.nf_conntrack_udp_timeout = 20

Will shorten UDP established/assures state timeout so your “games” will choke rouglly after 20s not pressing a key, like cutscenes etc.

You understand that games do not make zillions of connections to justify anomalous short timeouts impacting casual browsing.

1 Like

what would be a good margin, I went back to 60s

I’ve Raspberry Pi4 wtih 4GB RAM. These lines I’ve added at startup:

# Set CPU Governor:
echo schedutil | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

# cat /proc/interrupts
echo 8 >/proc/irq/14/smp_affinity
echo 8 >/proc/irq/30/smp_affinity
echo 2 >/proc/irq/27/smp_affinity
echo 4 >/proc/irq/28/smp_affinity

#Set optimized paramters
sysctl -w net.ipv4.tcp_ecn=1
sysctl -w net.ipv4.tcp_fack=1
sysctl -w net.ipv4.tcp_slow_start_after_idle=0
sysctl -w net.core.netdev_max_backlog=3000
sysctl -w net.core.somaxconn=8192
sysctl -w net.ipv4.tcp_rmem="4096 131072 12582912"
sysctl -w net.ipv4.tcp_wmem="4096 131072 12582912"

Adjust accordingly to your device.

Honestly, default settings are good enough. Just install the qosmate package to get A+ bufferbloat scores.

If you’re playing games on Windows, download Windows ADK, install “Windows Performance Toolkit,” and run Performance Recorder for a minute while you’re playing a game. Then, figure out the issues. For me, I found AV and some other drivers were causing huge CPU wait and DPC latency. Once I fixed those, I got a smooth gaming experience.

you can take out parmeters that pertain only local sockets, no influence from them on forwarded traffic at all

1 Like

hey thanks for the correction, I ended up testing various setups with iperf3 and full page load performance. Default settings are more than sufficient but I added these two lines:

sysctl -w net.ipv4.tcp_ecn=1 

# Enables Path MTU Discovery, which can help reduce packet loss
sysctl -w net.ipv4.tcp_mtu_probing=1 
net.ipv4.ip_early_demux = 0
net.ipv4.tcp_early_demux = 0
net.ipv4.udp_early_demux = 0

disable early SOCKET demuxing, useless activity when you are routing packets.

Also check

cat /proc/net/softnet_stat

If 2nd or 3rd column is less than 2 numbers to 1st they are worth peeking at.

This again applies to local sockets only.

Please post waveform result links, it is humanly impossible to feel under 10x speed or latency improvement.

  1. Setup 1:
    sysctl -w net.ipv4.tcp_ecn=1
    sysctl -w net.ipv4.tcp_mtu_probing=1

    Iperf3 test: iperf3 -c ``iperf3.moji.fr`` -p 5200 -P 8 -t 30

  2. Setup 2: Default (no paramters)
    Iperf3 test:

  3. Setup 3:
    net.ipv4.ip_early_demux = 0
    net.ipv4.tcp_early_demux = 0
    net.ipv4.udp_early_demux = 0

    Iperf3 test:

    softnet

You can game, but not 4K video stream, cannot improve that without extra bandwidth.

ecn on the router does exactly nothing for game traffic, demux is useful on very low end device clamping at CPU.

You can try various packet steering levels, install and enable irqbalance, but looks like BW is limited and router CPU is mostly idle saturating it and you will not notice between 1.5 and 0.5% CPU usage on the router.

1 Like

yes, the bandwidth is the only bottleneck. ECN parameter has significantly reduced retransmission retries in parallel connections also the quad-core CPU is already fast enough

I think manually setting IRQ is much better than using irqbalance itself in my case.

Router parameter does not change client ECN in any way, and game traffic is usually UDP with its own pacing if any.

If you want to keep it a black box, then just enjoy it.

Yes, the parameters mentioned are for TCP only. Modern games take advantage of UDP packets. Although Cake takes care of ECN by itself. So, I don’t understand why adding net.ipv4.tcp_ecn=1 drastically reduced retransmission retries in iperf3 test?

Did you run the iperf3 test from the router itself, or from a computer inside your LAN?

1 Like

Afaik game traffic is upd since we adopted IP.
Maybe TCP is used to discover servers in the lobby... Maybe chat too... But game traffic? It's udp.

And btw when you test with iperf and you want to test udp then you have to set the upd argument for iperf. And you need to set the bandwidth because default udp test is with 1 mbit only.