Short answer: plug your console or PC in with an Ethernet cable, then stop other traffic from flooding your connection by turning on SQM, if your router has it. Those two steps fix most lag spikes. The rest of your ping is mostly the distance to the game server, which no home setting can change.
What ping is made of
Ping is the round trip from your device to the game server and back. Part of it is distance and your provider’s network. The part you can control is what happens inside your home: Wi-Fi, and queues building up in your router when the connection is busy.
Step 1: play wired
A cable avoids Wi-Fi’s retries and interference. TP-Link notes, for example, that wired links between mesh units are more stable and faster than wireless ones. If running a cable isn’t practical, get as close to the router as you can.
Step 2: fix bufferbloat
The classic sign is lag that only appears when someone else is streaming, downloading or uploading. That’s bufferbloat: latency caused by network equipment buffering too much data. Your game packets wait in line behind everyone else’s traffic.
The fix is smarter queue management. CoDel, published as RFC 8289, is designed to control this excess delay. FQ-CoDel, RFC 8290, adds flow queuing, which isolates low-rate traffic such as game packets from bulk transfers so they don’t wait behind them. Routers usually offer this as SQM (Smart Queue Management) or an “adaptive” QoS mode.
When setting SQM up, OpenWrt’s guidance is to set the download and upload limits to about 90% of your measured speeds, then adjust. You give up a little top speed for much steadier latency. Our bufferbloat explainer shows how to test for it.
Step 3: improve your Wi-Fi
If you can’t play wired, a weak or crowded Wi-Fi link adds lag spikes of its own. Start with where to put your router, then check Wi-Fi channels if your neighbours’ networks are crowding yours.
What about “gaming modes”?
Prioritising game traffic can help, but it doesn’t create bandwidth. ASUS says its gaming mode raises the priority of game packets but doesn’t increase total bandwidth. Without queue management, a busy upload can still cause lag. See do you need a gaming router?
Check with your provider
Some providers are rolling out lower-latency technology. On cable, CableLabs’ Low Latency DOCSIS targets round-trip times under 5 ms in the cable network for traffic that doesn’t build queues, and DOCSIS 3.1 modems can be software-upgraded to support it. Ask your provider whether it’s available. Also check that you don’t have two routers in a row, which can cause NAT problems in online games; see double NAT explained.