Diagnosing/fixing periodic latency spikes that have seemingly external cause

Hi folks. This morning, I started observing periodic latency spikes over Wi-Fi. Things are below 5ms for 7-8 seconds, then for 3 seconds it ramps up to 150-200ms, then abruptly comes back down. Here's a graph of my ping from my laptop to my computer:

I believe this is not due to the router at all:

  • It's a Wi-Fi only problem. If I ping a Wi-Fi-connected device from the router, I get a similar result. If I ping an Ethernet-connected device from the router, I get a very steady 1ms ping.
  • If I ping 1.1.1.1 from my router, I get a fairly steady 2ms ping.
  • If I host a separate Wi-Fi network from one of my computers and connect with another computer, then ping the computers on that network, I get comparable latency spikes.

My two Wi-Fi computers are the same MacBook Pro models with the same macOS version and both experience these spikes. In theory, I imagine this could be a macOS issue, but I'm seeing the same problem from my phone, so at least there's a little bit of diversity in the Wi-Fi implementations that I tried with.

So, the question is: where do I go from there? I imagine that something in the air is too crowded, or that some device nearby generates substantial interference every 10 seconds or so. What can I try next to figure out what's going on?

You can use the built in OpenWrt channel analysis but it has a slow update.

I use an android only app WiFi Analyzer. It is free if all you want to do is check for congestion

1 Like

Thanks. I configured the router with wireless.radio1.channel='48' (which seems to be the emptiest channel here, with just one other network registering at -88dBm according to luci/admin/status/channel_analysis), but it doesn't seem to have resolved the problem. I still observe the same latency pattern: 7 or 8 seconds of good latency, then it ramps up to >150ms over 3 seconds.

Are there tools that could tell me what happens exactly every 10ish seconds?

The only next step I can think of is a spectrum analyzer. Especially since it not isolated to one channel.

I do not know of a cheap option. The 5GHz WiFi spectrum has no cheap option on Amazon.

Is it happening on 2.4 too?

1 Like

Try this:
Use Realtime graphs and choose to look at your lan traffic, it has a 3 second resolution; watch it for a couple of minutes.
This will surely catch it if it is something on your network phoning home.

This could be either of:
a) channel scanning, some end devices will scan all channels routinely and while doing so obviously can't carry traffic on the normal channel
b) power saving some WiFi power saving issues had been reported in the past resulting in cyclic delay spikes, maybe @dtaht could confirm or "sink" this hypothesis
c) for Apple specifically AWDL/Airdrop can cause WiFi delays, I use WiFriedX but I have not empirically confirmed that it actually helps... (I mostly wire up my macbook when I do serious work and when using WiFi I tend not to care all that much).

1 Like

This is what a channel scan used to look like while stressed out with the rrul test.

1 Like