macOS: wifi jitter

6. March 2021. Tagged mac, tricks.

Since I’ve been spending a good amount of the pandemic playing games using the cloud gaming offering, I have been somewhat dependent on a good internet connection. While pure bandwidth is important (both down- and upstream), the latency and stability of your connection are even more important.

This is mostly due to the fact, that with high latency your actions and the results are going to feel disjointed, which makes playing super frustrating and a lack of stability just means that you can’t even adjust to this, since sometimes it’ll happen or not.

Often this phenomenon of rapidly changing transmission speed on your connection is referred to as jitter.

For reasons, a tethered connection, which is definitely the best solution to get a highly reliable connection, was not an option, so I’ve been stuck with wifi.

On my mac I’ve seen two very interesting patterns, in terms of latency, that I’d like to share so that other people know how to deal with them:

Generally low latency with very regular spikes of high latency

When you have a healthy baseline latency but in regular intervals (e.g. every 15 minutes), this is very likely caused by location services on your mac. The mac does some magic in the background to determine your location based on the wifis available around you and for that to work it will temporarily suspend your connection.

To verify this, you can turn off location services completely (you can always turn them back on after). Find them under System Preferences → Security & Privacy → Privacy → Location Services. Just use the master switch.

Location services preferences on macOS

Location services preferences on macOS

Your latency is normally fine, but completely nuts sometimes

This happened to me a couple of times. Sometimes I had no jitter whatsoever, with a nice 20ms response times, sometimes I had high jitter and 100ms response times, which is unfortunately completely unplayable. I did a lot of research on this and by digging into various log files, there seemed to be a correlation with airdrop activity happen. There is no UI to turn this off easily in the preferences, however you can verify this easily using the command line. Simply run

sudo ifconfig awdl0 down

This should, if the underlying cause is airdrop, instantly fix this issue. While this is disabled, airdrop, icloud copy&paste and similar things will not work however. You can always turn this back on using the following command:

sudo ifconfig awdl0 up