16 ms·
Apple Maps location scan spikes WiFi latency every 60 seconds
- can16358p 4y agoI'm on Wi-Fi on my MacBook (Pro 16" 2021). I opened Maps.app (which gets my location correctly), started pinging my router, it's been a few minutes... No spike. It must be occuring at some corner case, not for everyone.
- djbeadle 4y agoI could not replicate after several minutes with the maps app open on my M1 MacBook Pro. I did find the Last.FM app seeming to request scans though?!
- op00to 4y agoTry pinging your router every .1 seconds.
- valiant-comma 4y agoIt happens to me when using Ubiquiti UniFi access points, but not as much with other brands of APs. In fact, certain models of UI APs seem to be more problematic when used with newer Macs.
- rob_c 4y agoGreat hardware with some crazy choices on top... at least the old intels use 3x antennas
- alaricus 4y agoThat can't be good for the battery life.
- nojito 4y agoThe default battery claims have location services turned on.
- ComputerGuru 4y agoI don’t think this does anything if maps isn’t running?
- urbandw311er 4y agoInterestingly, when I went to Security Preferences there was an icon to show that Apple Maps had used my location in the last 24 hours. This is in spite of almost never using Apple Maps on my MacBook, and certainly not in the last month. So this smells like some sort of background daemon or similar.
- ComputerGuru 4y agoWhile some platforms go through the Maps app to get the location, under macOS/iOS there's the locationd daemon that provides the location independently of any app. There, Maps is just a locationd consumer just like any other app requesting a location so Maps shouldn't be invoked in the background by non-Maps stuff. But perhaps Maps has a timed trigger to background update your cached location (so it can open up to the correct startup location instead of locating you after startup) or something similar.
- KennyBlanken 4y agoHmm. Did you hop into a vehicle you have paired with bluetooth? Apple Maps drops a "parked car" pin automatically when you do, I think regardless of whether it was in use at the time. Maybe you used an app that uses an Apple Maps view? Do you have any of the drive-time/traffic condition widgets active in the lefthand thingy, or homescreen?
- goodoldneon 4y agoLocation services in general seem to cause latency spikes for me. I just disabled the feature altogether
- tedunangst 4y agoI like that the first reply is to switch from zoom to google meet. Very helpful.
- herpderperator 4y agoThis is normal across all wifi clients; they can't scan for networks and transfer data simultaneously so there will always be increased latency during that event. You can test this yourself by doing a low-interval ping and clicking the wifi icon to show you nearby networks - you'll notice a brief latency spike. I agree that it's not a good default to have an app doing this, though.
- theptip 4y agoIt’s good to know. I suppose the unintuitive part is that “location” means “Wi-Fi scan”. Makes sense for a laptop when you think about it but I wouldn’t have thought of this as the first thing to check.
- culturestate 4y ago> the unintuitive part is that “location” means “Wi-Fi scan” I was under the impression that this has been SOP for mobile device location forever: get rough location via WiFi and/or tower multilateration while GPS is...I don't know the proper terminology here, bootstrapping? That's why your dot tends to start somewhere nearby-ish and then quicky jump to your exact location. It's possible that I'm way off base or my understanding is outdated, though.
- lillecarl 4y agoI'm thinking that my devices could have an offline list of known WiFi mac-addresses from when it's checked GPS before and return those for very accurate results without scanning anything.
- deleted 4y ago[deleted]
- Gigachad 4y ago> I don't know the proper terminology here, bootstrapping? There is the term "Time to first fix" Maybe "getting first fix" could be derived from that. Wikipedia lists a set of interesting situations with what the device is actually doing that causes the delay https://en.wikipedia.org/wiki/Time_to_first_fix https://en.wikipedia.org/wiki/Time_to_first_fix
- dpcx 4y agoI just tried this myself and can't replicate on a 2019 i7 running Big Sur. I wonder if it's related to the number of Wifi networks in range (mine is the only one)... Also, the Apple Maps thing didn't seem to change anything for me, either.
- foobarian 4y agoEnvironment can have huge impact on this. With a larger number of devices, there could be more collisions, increasing traffic more than linearly, and then in case of scanning traffic, the modulation used would likely be the lowest available which means the packets take up a lot of wall clock time. So a broadcast storm with collisions, retries, at the lowest bitrate = brief outage.
- altairprime 4y agoHow many saved wireless networks do you have?
- urda 4y agoI cannot replicate this, I believe the twitter use got hooked on a red herring here. To be fair anything anti-apple is a quick way to get clicks.
- mhh__ 4y agoAnything apple (both ways) is a good way to get clicks on hackernews at least.
- urda 4y agoThis is also true! I just can't replicate it, and another user ( leodriesch ) pointed out they may be a few versions behind. That's not something I can replicate right now.
- pessimizer 4y agoIt's a lot better than it used to be, when every Daring Fireball entry stayed on the front page for days.
- leodriesch 4y agoThe screenshots are from a version before the Big Sur visual refresh, so at least 2 major versions behind the current release. Could just be a bug that has been fixed already.
- urda 4y agoI did not realize this / check this. I had made the assumption of latest macOS and-what-have-you. I however, cannot setup that environment right now.
- outworlder 4y agoI saw infrequent scans from locationd, every few minutes. Until I opened the Maps app, that is. Then it started triggering frequent scans. Sure, Maps may want to know your location, but it should not have the ability to constantly poll wifi. Also, different chipsets may display different behavior. Older wifi chipsets may have more trouble with this.
- tda 4y agoI noticed this too when I used steam to stream a game to my laptop over good wifi. Every minute it would stutter for a second. I set up iperf3 tests and noticed the wifi lag increasing every minute between my macbook and my server and between my windows desktop pc and my server (when connected over wifi). Of course no lag when using cables, so I reasoned it was wifi related, and had noting to do with my setup (I used different clients, and different AP's). I then took my macbook (only portable computer I had) it too a nearby coffee shop with good wifi and I could still measure lag spikes every minute. So then I was really puzzled, was there some rogue device interfering with wifi all over the neighborhood? Finally I found a suggestion to turn off location services (or whatever it is called), and the spikes disappeared. And I learnt that even when it is not used (not sure it the lid was closed) a macbook can cause significant interference to the wifi for all other nearby devices.
- hoten 4y agoWow, I guess this is also why my local steam streaming (well, I use Moonlight but same difference) started lagging out of nowhere. I first noticed it 2 days ago, but before that I clocked 30 hours no problem, so I guess this is a brand new problem. Gonna try turning off all my Mac devices location services, thanks for the tip.
- tda 4y agoThis was a few years ago on a 2015 MBP running Catalina or whatever came before that. My guess is the adaptive bandwidth algorithm acutely switches to a lower bandwidth due to the lag spike, and then slowly recovers in the ten seconds after. And then 50 seconds later it starts over again. I suspect if I could have manually set the streaming quality to a fixed value the lag spike would hardly not be noticable at all, but the constant switching of the stream quality is what actually caused chopiness. Same might be the case with the OP's zoom calls
- deleted 4y ago[deleted]
- tomxor 4y ago> And I learnt that even when it is not used (not sure it the lid was closed) a macbook can cause significant interference to the wifi for all other nearby devices. My partner has an older MBP, I noticed this the last time she was forced to updated her OS a major version... the thing no longer sleeps when you tell it to or when you close the lid, it will stay connected to wifi and quite happily saturate the network downloading updates. Only way to be sure is to power off the stupid thing.
- Nextgrid 4y agoI wonder why they keep rescanning the wifi environment even though the fact that it remains connected to the same BSSID and the RSSI doesn’t fluctuate too much should suggest that it’s very unlikely the device moved far enough to warrant another scan.
- TSiege 4y agoportable wifi? edge case, but its possible this was the fix for it
- tedunangst 4y agolocationd probably wasn't tracking that state. Maybe now it is.
- deleted 4y ago[deleted]
- spookthesunset 4y agoMaybe it wasn’t a problem worth fixing at the time? Maybe they’ll do exactly this in future versions of the location finder stack. Edit: somebody pointed out that these scans could be for roaming purposes as well. Maybe there is another access point with a better signal and it’s time to move?
- Zelizz 4y agoMy anecdotal experience (partially informed by working on the Windows Wi-Fi team) is that iOS/macOS are more aggressive about switching APs. It's a tradeoff - on one hand, you can have disruptive scans like this, but on the other, if it results in switching to a better network during a long period when the user is stationary, it can result in a better experience. It also depends a lot on what your hardware is, whether you're doing a full scan or a partial scan, whether you have more than one NIC etc, etc.
- not2b 4y ago"better experience" only if you aren't doing something latency-sensitive, like a video call.
- daneel_w 4y agoA bit of a clickbait-y tweet. Exact same thing happens with any OS and Wi-Fi device when briefly scanning for surrounding access points. In the case of my setup (2017 MacBook Air running 10.15/Catalina) the penalty seems forgettable - avg. ping jumps from 2 ms to 25 ms during 1.5 seconds, on 802.11n/5GHz with about 20 other 2.4GHz/5GHz access points in my vicinity. My Asus ZenBook running Linux Mint and equipped with Intel Centrino Wi-Fi suffers a lot more from the same procedure.
- causi 4y agoWhy would someone program an OS to do this when it's already connected to an access point? This is like me eating a sandwich and stopping mid-chew every minute to check the fridge.
- amarshall 4y agoReason one is that one doesn’t generally connect to an access point (BSSID), but rather to a an SSID. That SSID may have many access points, as the device may roam. Periodic scans check to see if another access point for the same SSID is now a better choice, and switch accordingly. On Linux, configuring the connection to a specific BSSID generally disables periodic scans. Reason two is to determine location from WiFi network data. Location may not be static even if connected to a single network, since that network may cover a large area and be roam-able, or be moving (hotspot, train, etc.).
- spookthesunset 4y ago> Reason one is that one doesn’t generally connect to an access point (BSSID), but rather to a an SSID. That SSID may have many access points, as the device may roam. Periodic scans check to see if another access point for the same SSID is now a better choice, and switch accordingly. Maybe I don’t fully understand the Wi-Fi “space” but I gotta wonder why the standard hasn’t embraced a CDMA-like system where your device can just roam around without really caring which AP is the strongest… the access points would all communicate with each other to figure out which one should be responsible for a device. It would also fix all the nonsense with picking channels for each access point. They’d all use the same spectrum. But I’m only an armchair observer so who knows…
- rootusrootus 4y agoI cannot replicate this on my M1 MBP running 12.3.1.
- can16358p 4y agoSame. Have been trying for minutes with the same software running and on Wi-Fi. All pings around 4ms with no spikes at all.
- acchow 4y agoSame. Not able to replicate on M1 MBA Aren’t modern Wifi chips capable of holding two simultaneous connections (one for wifi, one for wifi-direct/Airdrop)?
- fragmede 4y agoThis happens on my M1 Macbook Air running 12.0.1 and is extremely evident when playing games on Stadia, unless location services is disabled.
- diebeforei485 4y agoWhy are you still running 12.0.1?
- tonymet 4y agoi became obsessed with mtr. your ping latency and variance is a better indicator of vc quality
- ncann 4y agoOn Windows, there was an infamous Qt bug that also caused regular ping spike, so check it out if you have the issue and you also happen to be using a Qt program: https://bugreports.qt.io/plugins/servlet/mobile#issue/QTBUG-40332/comment/390766 https://bugreports.qt.io/plugins/servlet/mobile#issue/QTBUG-...
- gernb 4y agoIs this why Airplay no longer works? As of MacOS 12.3 when I AirPlay from M1 to AppleTV every ~2 minutes it drops to ~1fps for ~30 seconds.
- wintermutestwin 4y agoLook into issues with Dolby Atmos on AppleTV and your soundbar.
- a-dub 4y agolol. i wonder if it's quietly popping the nic out of the associated state, quickly scanning for aps and then jumping back where it left off without telling userland or the remote ap that anything happened...
- qwertywert_ 4y agoBackground scanning is a normal WiFi feature, you don't break association state when doing this. It is required for regular and fast roaming. Also it must be notifying userland it happened because location services is trying to gather that info. Most WiFi clients enable background scanning when signal strength is below some threshold, so you would never notice latency spikes unless connection is already poor.
- a-dub 4y agointeresting. so they just switch it on even when the signal is strong. > Most WiFi clients enable background scanning when signal strength is below some threshold, so you would never notice latency spikes unless connection is already poor. i assume s/unless/because/ ?
- robbomacrae 4y agoAs a means to keeping this feature on when out in public, but not have it cause latency spikes at home, is it possible to configure the router to block these requests from location services? Or do we need to setup each device to automatically disable location services when on the house wifi?
- lxgr 4y agoWifi positioning does not actively talk to the network you‘re connected to, but rather does a beacon frame sweep and then matches BSSIDs seen with some database. One side effect of this is that in order to scan all possible wifi channels, your baseband needs to tune to different frequencies at least for a short period of time. Theoretically this interval should be short enough to avoid any disruptions – practically that‘s apparently not always the case.
- hotfixguru 4y agoThis have happened since 12.3.1 at the office for me (not at home though). Hope this resolves it.
- hamter 4y agoit's location services, not apple maps.
- GekkePrutser 4y agoOk that sucks. If they do a scan, at least use the radio that's not in use so it doesn't affect the one communicating (e.g. use 2.4 Ghz when you're connected on 5).. That would be a good way to avoid this latency hit. Also, I'm assuming Maps only does this when it's open, but Apple's annoying tendency to keep an app running when you close the last window (with the exception of system preferences and a few others) makes this very hard to diagnose. While I still used Macs a lot I would always close apps with Command-Q for that reason. This behaviour would exacerbate the problem as the user isn't aware that the app is stil running. Apple's reasoning is I believe to "not worry about open apps, the OS will handle it". But it doesn't always, I often get prompts that my memory is full and I have to close something now or else... And that is with me being rigorous closing apps. My work buys only base level machines with standard ram, unfortunately.
- JoeAltmaier 4y agoOften the antenna is shared - its a relatively large physical thing. And it can't really be shared except time-shared I believe.
- GekkePrutser 4y agoThe frequencies are different enough for it to be possible technically. The same way mobile phones can be active on multiple bands at the same time. But indeed the used chipset may not support it. It's something I would expect Apple to have taken advantage of though, as they own both the hardware and the software.
- cmckn 4y ago> Apple's annoying tendency to keep an app running when you close the last window This is…just how macOS works. Windows applications (generally) tie their lifecycle to the existence of a window, but Macs have a different paradigm: the program can live without any windows. Pretty much every Mac app behaves this way. It’s been this way as long as I can remember. iOS is different; you can force close an app with the app switcher, but the OS generally encourages you to leave things “open” and the OS will periodically wake your process so it can perform various tasks. The OS is very stingy about how much work your process can do when it’s in the background in this way. This is one of the challenges when developing for iOS, for sure.
- kylecordes 4y agoI noticed this when using a meeting/streaming tool that detected these bits of latency and went in to a degraded mode, even with abundant bandwidth available. I tried the various settings for avoiding it, discussed in many other comments here. The only thing that worked for me: get out a USB ethernet adapter and a long wire, don't use WiFi when doing things where it matters. ... which is ridiculous; I don't want or need location scans at all, I am sitting stationary in my home office.
- nvr219 4y agoI set up automation to prompt me to turn off WiFi when I leave the house.
- defen 4y agoIs this the "weird WiFi latency on Mac OS" thread? I've got a WiFi network with a MacBook Pro (running 11.6 because I hate upgrading) and a System76 linux box (as well as lots of other devices). Both of the machines can ping a google dot com server (which is approximately 150 miles away, going by the hostname) consistently in the 8-12 ms range. Pinging the System76 box from the laptop, the latency varies from 2-250(!) ms. Pinging the laptop from the System76 box varies from 2-125ms. I don't even know where to start debugging that but the latency is driving me crazy.
- brohoolio 4y agoI’ve seen this sporadically. A reboot clears it for me. I probably spent a good hour trying to figure out if it was my ISP or router. Improve your QA Apple
- pabs3 4y agoWhy do network scans spike latency? Seems like a WiFi firmware bug to me. I wonder if it happens with open source WiFi firmware like ath9k_htc.fw https://github.com/qca/open-ath9k-htc-firmware https://github.com/qca/open-ath9k-htc-firmware
- op00to 4y agoWifi chipsets can't scan networks and do regular wifi-y stuff at the same time.
- kalleboo 4y agoThat seems odd, when they can connect to 2 networks at the same time
- octoberfranklin 4y agoOnly if either (a) both networks use the same channel or (b) the networks use different bands (i.e. one is 5ghz and the other is 2.4ghz). In order to scan usefully you need to listen on more than one channel from each band. Hence, the interruptions. I suppose in theory if you were using a 5ghz network you could scan all the 2.4ghz frequencies. In practice there is little demand for this, so the proprietary firmwares don't support it (at least some, and often all, of the scan routine happens in firmware).
- kalleboo 4y agoThis is really interesting so I did an experiment. I connected my iPhone to a 5 GHz-only network on channel 36, and my MacBook Pro to a 5 GHz-only network on channel 48, and I could still AirDrop between them at 300 MBit (which exceeds any real-world speed I've seen on 2.4 GHz), and both devices retained connectivity (an iperf on the MacBook dropped from 600 Mbit to 300 Mbit while the AirDrop was in progress) After messing around with this and sending around 10 AirDrops, now the feature is completely broken no matter what I do (same network, etc) so who knows (lol)
- 4y ago
- captainredbeard 4y agoKids, this is why you should randomize when clients check in if your model allows it.
- whazor 4y agoBest is to disable location services, which results into multiple disadvantages: - maps don't show your location, which you would have to live with.. - I recommend F.lux instead of night shift and dark mode: you can manually configure a location in F.lux and let it enable dark mode as well. - also manually set time zone
- phineyes 4y agoIt's not just Apple Maps either! Even with location services disabled, try opening AirDrop (even on another device you own) while running a ping and you'll see your en0 device's latency spike, while Apple tries to divide traffic between awdl0 and en0.
- bemmu 4y agoI see system_profiler doing a scan when I gather the logs. Is that just the logger itself doing something, and if not is there a way to find what it invoking system_profiler?
- lscpike 4y agoI discovered this exact problem over lock down 2020. My Teams calls would freeze every 60s. There's a better solution though! Delete all your saved wifi connections. All those hotels and coffee shops you have connected to in your apple lifetime are the trigger. Reduce them down to those you actually use and the problem goes away. I'm amazed more people haven't come across this, though from what I've seen people tend to just live with these problems as they don't know where to start in figuring it out.
- deleted 4y ago[deleted]
- NonNefarious 4y ago
- londons_explore 4y agoIt's 2022. Apple should just have a separate WiFi radio for location scans.
- jokoon 4y agoOther anecdote: I have a thinkpad L450, and randomly during the day, the wifi firmware just "crashes" and disable itself, and needs to be reset via the "troubleshoot" dialog in windows 10. It's quite annoying, and I can't really think of why it happens. I wonder if radio interference might be a cause.
- boesboes 4y agoSo I've tried this and cannot reproduce anything like it. Yes, when I tell Macos to scan for network, there is a short latency spike, as can be expected. But _only_ when I open up the networks menu. I have maps open, refresh my location etc. Nothing at all. So there must be some other factors at play. Given the authors wireless woes that I've never had trouble with, I feel like they might just be living in a bunch of farayday cages ;)
- daverstam 4y agoThis has been an issue for at least over a year. Turn off location services and disable the awdl0 interface is the only way (for me) to run lag free zoom calls over wifi with a mac. https://support.google.com/stadia/answer/9595943?hl=en#zippy=%2Cmac-and-ios-troubleshooting https://support.google.com/stadia/answer/9595943?hl=en#zippy...
- alophawen 4y agoPlease read the article you are commenting on. In it, they identify the cause and lay out a solution. The solution is not to botch your macbook by disabling core components as AWDL (disabling it will break airplay, handoff and other).
- daverstam 4y agoNot sure why you assumed I did not read the article. Anyway I just wanted to point out that this has been and still is an issue recognized by Google Stadia and others. Moonlight project issue discussed in the thread are also recommending to disable awdl to mitigate the issue https://github.com/moonlight-stream/moonlight-qt/issues/159 https://github.com/moonlight-stream/moonlight-qt/issues/159 I never ment to step on any toes, just wanted to raise possible solutions.
- Angostura 4y agoSilly question - but does this problem occur only when Maps is running? Or is there a background daemon doing this stuff? I've never had this problem on my iMac