使用 macOS Sierra 时,WiFi 每隔一秒就会出现高延迟

使用 macOS Sierra 时,WiFi 每隔一秒就会出现高延迟

在运行最新 macOS Sierra 的 Macbook Pro 上,我每隔一秒就会遇到较高的 wifi 延迟。

我以为我的旧路由器可能是罪魁祸首,所以我买了一个新的。然而,新路由器只会让情况变得更糟,从延迟问题到大约 20% 的数据包丢失。尝试此解决方案另一个超级用户的问题至少将数据包丢失再次降至 0,但延迟问题仍然存在。

  • 通过有线网络从另一台机器 ping 同一路由器,结果得到稳定的 2ms ping。
  • 通过 WiFi 用我的手机进行 ping 操作,结果是稳定的 4ms ping(旧的 Android 手机)。
  • 在我工作的网络上运行相同的测试,结果完全相同。我发现问题出在我的 Macbook Pro 的 Wi-Fi 上。

这是来自 speedtest.net 的图表。每次我在 wifi 上运行此测试时,我都会得到相同的结果:下载速度下降约 5 秒。

下载速度图表

当我从我的 MBP ping 192.168.1.1 的路由器时(默认频率为 1 Hz),我得到以下模式:

64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=86.944 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=121.099 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=1.664 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=31.493 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=66.042 ms
64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=99.786 ms
64 bytes from 192.168.1.1: icmp_seq=6 ttl=64 time=2.459 ms
64 bytes from 192.168.1.1: icmp_seq=7 ttl=64 time=2.183 ms
64 bytes from 192.168.1.1: icmp_seq=8 ttl=64 time=1.867 ms
64 bytes from 192.168.1.1: icmp_seq=9 ttl=64 time=2.662 ms
64 bytes from 192.168.1.1: icmp_seq=10 ttl=64 time=2.065 ms
64 bytes from 192.168.1.1: icmp_seq=11 ttl=64 time=0.877 ms
64 bytes from 192.168.1.1: icmp_seq=12 ttl=64 time=63.238 ms
64 bytes from 192.168.1.1: icmp_seq=13 ttl=64 time=101.419 ms
64 bytes from 192.168.1.1: icmp_seq=14 ttl=64 time=3.704 ms
64 bytes from 192.168.1.1: icmp_seq=15 ttl=64 time=36.746 ms
64 bytes from 192.168.1.1: icmp_seq=16 ttl=64 time=51.972 ms
64 bytes from 192.168.1.1: icmp_seq=17 ttl=64 time=86.453 ms
64 bytes from 192.168.1.1: icmp_seq=18 ttl=64 time=125.786 ms
64 bytes from 192.168.1.1: icmp_seq=19 ttl=64 time=1.113 ms
64 bytes from 192.168.1.1: icmp_seq=20 ttl=64 time=1.973 ms
64 bytes from 192.168.1.1: icmp_seq=21 ttl=64 time=2.575 ms
64 bytes from 192.168.1.1: icmp_seq=22 ttl=64 time=1.957 ms
64 bytes from 192.168.1.1: icmp_seq=23 ttl=64 time=2.209 ms
64 bytes from 192.168.1.1: icmp_seq=24 ttl=64 time=2.815 ms
64 bytes from 192.168.1.1: icmp_seq=25 ttl=64 time=1.924 ms
64 bytes from 192.168.1.1: icmp_seq=26 ttl=64 time=150.076 ms
64 bytes from 192.168.1.1: icmp_seq=27 ttl=64 time=53.943 ms
64 bytes from 192.168.1.1: icmp_seq=28 ttl=64 time=84.633 ms
64 bytes from 192.168.1.1: icmp_seq=29 ttl=64 time=109.776 ms

以 10 Hz 的频率执行 ping 操作也会出现类似的情况,并且会出现数据包丢失:

64 bytes from 192.168.1.1: icmp_seq=11 ttl=64 time=1.078 ms
64 bytes from 192.168.1.1: icmp_seq=12 ttl=64 time=1.347 ms
64 bytes from 192.168.1.1: icmp_seq=13 ttl=64 time=1.041 ms
64 bytes from 192.168.1.1: icmp_seq=14 ttl=64 time=1.031 ms
64 bytes from 192.168.1.1: icmp_seq=15 ttl=64 time=1.098 ms
64 bytes from 192.168.1.1: icmp_seq=16 ttl=64 time=1.098 ms
64 bytes from 192.168.1.1: icmp_seq=17 ttl=64 time=0.944 ms
64 bytes from 192.168.1.1: icmp_seq=18 ttl=64 time=3.185 ms
64 bytes from 192.168.1.1: icmp_seq=19 ttl=64 time=8.736 ms
64 bytes from 192.168.1.1: icmp_seq=20 ttl=64 time=6.846 ms
64 bytes from 192.168.1.1: icmp_seq=21 ttl=64 time=1.009 ms
64 bytes from 192.168.1.1: icmp_seq=22 ttl=64 time=0.900 ms
64 bytes from 192.168.1.1: icmp_seq=23 ttl=64 time=0.985 ms
64 bytes from 192.168.1.1: icmp_seq=24 ttl=64 time=0.898 ms
64 bytes from 192.168.1.1: icmp_seq=25 ttl=64 time=0.919 ms
64 bytes from 192.168.1.1: icmp_seq=26 ttl=64 time=3.679 ms
64 bytes from 192.168.1.1: icmp_seq=27 ttl=64 time=1.468 ms
64 bytes from 192.168.1.1: icmp_seq=28 ttl=64 time=6.889 ms
64 bytes from 192.168.1.1: icmp_seq=29 ttl=64 time=0.953 ms
64 bytes from 192.168.1.1: icmp_seq=30 ttl=64 time=1.076 ms
64 bytes from 192.168.1.1: icmp_seq=31 ttl=64 time=0.984 ms
64 bytes from 192.168.1.1: icmp_seq=32 ttl=64 time=0.946 ms
64 bytes from 192.168.1.1: icmp_seq=33 ttl=64 time=0.872 ms
64 bytes from 192.168.1.1: icmp_seq=34 ttl=64 time=0.844 ms
Request timeout for icmp_seq 35
64 bytes from 192.168.1.1: icmp_seq=35 ttl=64 time=169.385 ms
64 bytes from 192.168.1.1: icmp_seq=36 ttl=64 time=68.897 ms
64 bytes from 192.168.1.1: icmp_seq=37 ttl=64 time=203.066 ms
64 bytes from 192.168.1.1: icmp_seq=38 ttl=64 time=98.576 ms
64 bytes from 192.168.1.1: icmp_seq=39 ttl=64 time=0.891 ms
64 bytes from 192.168.1.1: icmp_seq=40 ttl=64 time=122.991 ms
64 bytes from 192.168.1.1: icmp_seq=41 ttl=64 time=18.420 ms
64 bytes from 192.168.1.1: icmp_seq=42 ttl=64 time=90.086 ms
64 bytes from 192.168.1.1: icmp_seq=43 ttl=64 time=1.029 ms
64 bytes from 192.168.1.1: icmp_seq=44 ttl=64 time=65.268 ms
64 bytes from 192.168.1.1: icmp_seq=45 ttl=64 time=92.355 ms
64 bytes from 192.168.1.1: icmp_seq=46 ttl=64 time=0.922 ms
64 bytes from 192.168.1.1: icmp_seq=47 ttl=64 time=66.303 ms
64 bytes from 192.168.1.1: icmp_seq=49 ttl=64 time=38.938 ms
Request timeout for icmp_seq 50
64 bytes from 192.168.1.1: icmp_seq=50 ttl=64 time=129.508 ms
64 bytes from 192.168.1.1: icmp_seq=51 ttl=64 time=24.909 ms
64 bytes from 192.168.1.1: icmp_seq=52 ttl=64 time=86.077 ms
64 bytes from 192.168.1.1: icmp_seq=53 ttl=64 time=0.967 ms
64 bytes from 192.168.1.1: icmp_seq=54 ttl=64 time=198.241 ms
64 bytes from 192.168.1.1: icmp_seq=55 ttl=64 time=93.977 ms
64 bytes from 192.168.1.1: icmp_seq=56 ttl=64 time=0.886 ms
64 bytes from 192.168.1.1: icmp_seq=57 ttl=64 time=70.865 ms
64 bytes from 192.168.1.1: icmp_seq=58 ttl=64 time=0.809 ms
64 bytes from 192.168.1.1: icmp_seq=59 ttl=64 time=41.784 ms
Request timeout for icmp_seq 61
64 bytes from 192.168.1.1: icmp_seq=62 ttl=64 time=90.258 ms
64 bytes from 192.168.1.1: icmp_seq=63 ttl=64 time=1.207 ms
64 bytes from 192.168.1.1: icmp_seq=64 ttl=64 time=56.740 ms
64 bytes from 192.168.1.1: icmp_seq=65 ttl=64 time=85.553 ms
64 bytes from 192.168.1.1: icmp_seq=66 ttl=64 time=0.877 ms
64 bytes from 192.168.1.1: icmp_seq=67 ttl=64 time=62.510 ms
64 bytes from 192.168.1.1: icmp_seq=68 ttl=64 time=1.423 ms
64 bytes from 192.168.1.1: icmp_seq=69 ttl=64 time=32.156 ms
Request timeout for icmp_seq 70
64 bytes from 192.168.1.1: icmp_seq=70 ttl=64 time=116.203 ms
64 bytes from 192.168.1.1: icmp_seq=71 ttl=64 time=12.917 ms
64 bytes from 192.168.1.1: icmp_seq=72 ttl=64 time=86.092 ms
64 bytes from 192.168.1.1: icmp_seq=73 ttl=64 time=0.886 ms
64 bytes from 192.168.1.1: icmp_seq=74 ttl=64 time=59.710 ms
64 bytes from 192.168.1.1: icmp_seq=75 ttl=64 time=90.512 ms
64 bytes from 192.168.1.1: icmp_seq=76 ttl=64 time=4.074 ms
64 bytes from 192.168.1.1: icmp_seq=77 ttl=64 time=111.984 ms
64 bytes from 192.168.1.1: icmp_seq=78 ttl=64 time=8.640 ms
64 bytes from 192.168.1.1: icmp_seq=79 ttl=64 time=152.531 ms
64 bytes from 192.168.1.1: icmp_seq=80 ttl=64 time=47.904 ms
64 bytes from 192.168.1.1: icmp_seq=81 ttl=64 time=0.907 ms
64 bytes from 192.168.1.1: icmp_seq=82 ttl=64 time=75.134 ms
64 bytes from 192.168.1.1: icmp_seq=83 ttl=64 time=1.012 ms
64 bytes from 192.168.1.1: icmp_seq=84 ttl=64 time=42.029 ms
64 bytes from 192.168.1.1: icmp_seq=85 ttl=64 time=116.824 ms
64 bytes from 192.168.1.1: icmp_seq=86 ttl=64 time=14.382 ms
64 bytes from 192.168.1.1: icmp_seq=87 ttl=64 time=49.502 ms
64 bytes from 192.168.1.1: icmp_seq=88 ttl=64 time=121.049 ms
64 bytes from 192.168.1.1: icmp_seq=89 ttl=64 time=21.011 ms
64 bytes from 192.168.1.1: icmp_seq=90 ttl=64 time=95.133 ms
64 bytes from 192.168.1.1: icmp_seq=91 ttl=64 time=1.043 ms
64 bytes from 192.168.1.1: icmp_seq=92 ttl=64 time=67.754 ms
64 bytes from 192.168.1.1: icmp_seq=93 ttl=64 time=0.876 ms
64 bytes from 192.168.1.1: icmp_seq=94 ttl=64 time=39.027 ms
64 bytes from 192.168.1.1: icmp_seq=95 ttl=64 time=110.931 ms
64 bytes from 192.168.1.1: icmp_seq=96 ttl=64 time=7.023 ms
64 bytes from 192.168.1.1: icmp_seq=97 ttl=64 time=36.249 ms
64 bytes from 192.168.1.1: icmp_seq=98 ttl=64 time=116.108 ms
64 bytes from 192.168.1.1: icmp_seq=99 ttl=64 time=11.732 ms
64 bytes from 192.168.1.1: icmp_seq=100 ttl=64 time=82.880 ms
64 bytes from 192.168.1.1: icmp_seq=101 ttl=64 time=0.956 ms
64 bytes from 192.168.1.1: icmp_seq=102 ttl=64 time=58.007 ms
64 bytes from 192.168.1.1: icmp_seq=103 ttl=64 time=126.818 ms
64 bytes from 192.168.1.1: icmp_seq=104 ttl=64 time=22.750 ms
64 bytes from 192.168.1.1: icmp_seq=105 ttl=64 time=99.126 ms
64 bytes from 192.168.1.1: icmp_seq=106 ttl=64 time=131.419 ms
64 bytes from 192.168.1.1: icmp_seq=107 ttl=64 time=28.596 ms
64 bytes from 192.168.1.1: icmp_seq=108 ttl=64 time=110.326 ms
64 bytes from 192.168.1.1: icmp_seq=109 ttl=64 time=5.859 ms
64 bytes from 192.168.1.1: icmp_seq=110 ttl=64 time=70.852 ms
64 bytes from 192.168.1.1: icmp_seq=111 ttl=64 time=0.855 ms
64 bytes from 192.168.1.1: icmp_seq=112 ttl=64 time=41.162 ms
64 bytes from 192.168.1.1: icmp_seq=113 ttl=64 time=114.014 ms
64 bytes from 192.168.1.1: icmp_seq=114 ttl=64 time=9.519 ms
Request timeout for icmp_seq 116
64 bytes from 192.168.1.1: icmp_seq=116 ttl=64 time=121.307 ms
64 bytes from 192.168.1.1: icmp_seq=117 ttl=64 time=16.106 ms
64 bytes from 192.168.1.1: icmp_seq=118 ttl=64 time=1.082 ms
64 bytes from 192.168.1.1: icmp_seq=119 ttl=64 time=1.086 ms
64 bytes from 192.168.1.1: icmp_seq=120 ttl=64 time=1.386 ms
64 bytes from 192.168.1.1: icmp_seq=121 ttl=64 time=1.002 ms
64 bytes from 192.168.1.1: icmp_seq=122 ttl=64 time=5.472 ms
64 bytes from 192.168.1.1: icmp_seq=123 ttl=64 time=1.060 ms
64 bytes from 192.168.1.1: icmp_seq=124 ttl=64 time=1.526 ms
64 bytes from 192.168.1.1: icmp_seq=125 ttl=64 time=0.998 ms
64 bytes from 192.168.1.1: icmp_seq=126 ttl=64 time=1.182 ms
64 bytes from 192.168.1.1: icmp_seq=127 ttl=64 time=0.942 ms
64 bytes from 192.168.1.1: icmp_seq=128 ttl=64 time=3.221 ms
64 bytes from 192.168.1.1: icmp_seq=129 ttl=64 time=16.895 ms
64 bytes from 192.168.1.1: icmp_seq=130 ttl=64 time=1.251 ms
64 bytes from 192.168.1.1: icmp_seq=131 ttl=64 time=3.832 ms
64 bytes from 192.168.1.1: icmp_seq=132 ttl=64 time=5.403 ms
64 bytes from 192.168.1.1: icmp_seq=133 ttl=64 time=1.194 ms
64 bytes from 192.168.1.1: icmp_seq=134 ttl=64 time=1.287 ms
64 bytes from 192.168.1.1: icmp_seq=135 ttl=64 time=2.274 ms
64 bytes from 192.168.1.1: icmp_seq=136 ttl=64 time=0.863 ms
64 bytes from 192.168.1.1: icmp_seq=138 ttl=64 time=1.200 ms

换句话说:正常 ping 大约需要 5 秒,然后如果 ping 频率足够高,则会出现大约 5 秒的严重延迟问题甚至超时。

我试图弄清楚是否最近安装的应用程序导致了这种情况,所以我已经禁用了大多数应用程序(Dropbox、Little Snitch)。不过现在我没办法了。我刚刚在 ping 时运行了 Wireshark,除了这些 ping 之外,没有看到任何网络活动。

我不确定我还能尝试什么来解决这个问题。

答案1

我已经在这里解决了这个问题:https://apple.stackexchange.com/a/348574/317354

总结:

  • 罪魁祸首是定位服务和 WiFi 扫描
  • 检查定位服务是否启用
  • 按住Option键盘键,点击顶部工具栏中的 WiFi 图标,点击Enable Wi-Fi Logging
  • 在终端执行:ping 8.8.8.8 -i 0.1
  • 在新窗口中的终端中执行:tail -f /var/log/wifi.log。并排观察,等待故障。
  • 当发现故障时检查日志,终止该程序。

答案2

我在许多论坛上回答了同样的问题。

答案是 - macOS ping 在 WiFi 扫描期间会达到峰值。尝试运行 ping 并单击顶部的 WiFi 图标 - 您会亲眼看到。

因此,您的计算机上的某些程序会触发 WiFi 扫描。很有可能,这是浏览器插件试图对您进行地理定位。关闭所有浏览器,看看是否有所改善。

答案3

我直接关闭了 Wi-Fi 进程(它会自动重启),然后一切就恢复正常了。这可能是一个短期修复,但快速又简单。

答案4

我遇到了同样的问题并解决了我的问题。

您必须重新启动 Mac 并以安全模式打开。然后再次重新启动 Mac。要以安全模式打开 Mac,您可以重新启动 Mac 并在再次打开时按住 Shift。

您也可以查看这个网站...

http://osxdaily.com/2016/09/22/fix-wi-fi-problems-macos-sierra/ http://osxdaily.com/2010/04/20/using-safe-boot-mode-in-mac-os-x/

相关内容