Multipeer Connectivity Mac WiFi Speed Degradation

Just been experimenting with Multipeer Connectivity on OS X, but I've found that when advertising on OS X using MCNearbyServiceAdvertiser and [_nearbyServiceAdvertiser startAdvertisingPeer] the wifi speeds on my Mac drop dramatically.


It happens consistently too. I'm using a 12" Retina MacBook, during a speed test if I start the advertiser the internet speed drops significantly, and returns to normal when I stop the advertiser.


I've tried running it on a different thread but it makes no difference. As it stands, it does not make it a viable alternative to using Bonjour alone, which is unfortunate because it gives you the backup of not needing a local network for communication.


Anyone got any ideas/experience? I need to test on another machine before submitting a radar.

Replies

I've filed a bug report as I can reproduce it on another Mac too.

Unfortunately you're hitting fundamental problems with how Apple's peer-to-peer technologies work. Specifically:

  • Bluetooth and Wi-Fi share an antenna, resulting in serious coexistence challenges.

  • Apple's peer-to-peer Wi-Fi implementation—specifically the service discovery on peer-to-peer Wi-Fi—has coexistence issues with infrastructure Wi-Fi.

There are two general strategies to avoid these problems:

  • Stop discovery once you've connected / are transferring. You can apply this regardless of which API you're using.

  • Constrain your interfaces. With lower-level APIs you can tell the API not to use peer-to-peer, or to use peer-to-peer over only one interface, both of which can help.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I'm running into the same problem. Even if call `stopAdvertisingPeer()` the wifi degradation persists. I remember a similar issue with `NetServiceBrowser` years ago but it improved at some point.

Even if call

stopAdvertisingPeer()
the wifi degradation persists.

How long for? In my experience it can take a while for the peer-to-peer Wi-Fi subsystem to close down, and thus it continues to affect Wi-Fi performances for a few minutes after you stop using it actively.

It’s also possible that Multipeer Connectivity is doing something weird in this space. If you never see Wi-Fi performance recover then it’d be interesting to run an equivalent test with a lower-level Bonjour API (like

NSNetServiceBrowser
, as you mentioned).

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"