サーバーに十分な帯域幅がありますが、Pingが遅くなります。

サーバーに十分な帯域幅がありますが、Pingが遅くなります。

こんにちはstackoverflowコミュニティ、遅いpingの原因を理解するのに助けが必要です。

(これは私が得たアドバイスに基づいてStackoverflowからコピーされました。)

コンテキスト

  • 2台のLinuxサーバーがあります。
    1. ラズベリーパイ4
    • カーネルは5.4.0-1042-raspi
    1. Lenovo n75qマイクロgen2
    • カーネルは5.4.0-89-generic
  • ファイルは同じ/etc/netplan/99_config.yamlで、同じWi-Fiネットワークに属しています。
  • 彼らはすべてインターネットに接続されており、外部世界のコンテンツを検索できます。 (私の言葉は、カールが両方のサーバーで動作することを意味します)
  • CPUが使用されておらず、メモリが十分です。

質問

  • SSHを介して2番目のサーバー(Lenovo)にアクセスすると、応答が非常に遅くなります。 (毎回非常にゆっくりと入力)
    • ただし、Raspberry Piよりも帯域幅が優れています。
    • これを調査しながら発見した唯一の奇妙な事実は、lenovoへのpingがrasberry piのものよりも遅いということです。
  • ラズベリーパイは非常にスムーズに動作/応答します。

質問

  • SSHを介してlenovoにアクセスすると遅延するのはなぜですか?
  • (Pingが遅くなる原因が同じ場合)どうすれば解決できますか?

アイパフ結果

# rasberry pi
[ ID] Interval       Transfer     Bandwidth
[  4] local 192.168.3.13 port 5001 connected with 192.168.3.2 port 52172
[  4]  0.0-12.8 sec   100 MBytes  65.6 Mbits/sec
[  4] local 192.168.3.13 port 5001 connected with 192.168.3.2 port 52248
[  4]  0.0-153.3 sec  1000 MBytes  54.7 Mbits/sec

# lenovo
[ ID] Interval       Transfer     Bandwidth
[  4] local 192.168.3.11 port 5001 connected with 192.168.3.2 port 52163
[  4]  0.0-12.4 sec   100 MBytes  67.6 Mbits/sec
[  4] local 192.168.3.11 port 5001 connected with 192.168.3.2 port 52180
[  4]  0.0-64.8 sec  1000 MBytes   129 Mbits/sec
[  4] local 192.168.3.11 port 5001 connected with 192.168.3.2 port 52312
[  4]  0.0-68.4 sec  1000 MBytes   123 Mbits/sec

速度テスト結果

# rasberry pi
$ speedtest
Retrieving speedtest.net configuration...
Testing from Softbank BB ...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by denpa893 (Tokyo) [4.11 km]: 18.09 ms
Testing download speed................................................................................
Download: 53.25 Mbit/s
Testing upload speed......................................................................................................
Upload: 58.68 Mbit/s

# lenovo
$ speedtest
Retrieving speedtest.net configuration...
Testing from Softbank BB ...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by NEVERLOSS LLC. (Tokyo) [4.11 km]: 12.093 ms
Testing download speed................................................................................
Download: 189.07 Mbit/s
Testing upload speed......................................................................................................
Upload: 74.77 Mbit/s

pingの結果

# rasberry pi
$ ping -s 1000 192.168.3.13
PING 192.168.3.13 (192.168.3.13): 1000 data bytes
1008 bytes from 192.168.3.13: icmp_seq=0 ttl=64 time=79.925 ms
1008 bytes from 192.168.3.13: icmp_seq=1 ttl=64 time=10.203 ms
1008 bytes from 192.168.3.13: icmp_seq=2 ttl=64 time=13.297 ms
1008 bytes from 192.168.3.13: icmp_seq=3 ttl=64 time=9.976 ms
1008 bytes from 192.168.3.13: icmp_seq=4 ttl=64 time=2.932 ms
1008 bytes from 192.168.3.13: icmp_seq=5 ttl=64 time=9.611 ms
1008 bytes from 192.168.3.13: icmp_seq=6 ttl=64 time=2.983 ms
1008 bytes from 192.168.3.13: icmp_seq=7 ttl=64 time=12.698 ms
1008 bytes from 192.168.3.13: icmp_seq=8 ttl=64 time=3.286 ms
1008 bytes from 192.168.3.13: icmp_seq=9 ttl=64 time=3.937 ms
1008 bytes from 192.168.3.13: icmp_seq=10 ttl=64 time=2.689 ms

# lenovo
$ ping -s 1000 192.168.3.11
PING 192.168.3.11 (192.168.3.11): 1000 data bytes
1008 bytes from 192.168.3.11: icmp_seq=0 ttl=64 time=211.042 ms <--- much slower than rasberry pi
1008 bytes from 192.168.3.11: icmp_seq=1 ttl=64 time=26.955 ms
1008 bytes from 192.168.3.11: icmp_seq=2 ttl=64 time=47.657 ms
1008 bytes from 192.168.3.11: icmp_seq=3 ttl=64 time=172.856 ms
1008 bytes from 192.168.3.11: icmp_seq=4 ttl=64 time=194.496 ms
1008 bytes from 192.168.3.11: icmp_seq=5 ttl=64 time=216.379 ms
1008 bytes from 192.168.3.11: icmp_seq=6 ttl=64 time=134.123 ms
1008 bytes from 192.168.3.11: icmp_seq=7 ttl=64 time=155.828 ms

トレースパス結果

# rasberry pi
$ traceroute 192.168.3.11
traceroute to 192.168.3.11 (192.168.3.11), 64 hops max, 52 byte packets
 1  ${rasberry pi} (192.168.3.11)  4.122 ms  2.568 ms  2.109 ms

# lenovo
$ traceroute 192.168.3.13
traceroute to 192.168.3.13 (192.168.3.13), 64 hops max, 52 byte packets
 1  * ${lenovo} (192.168.3.13)  105.194 ms  3.069 ms

人気の検索結果

# rasberry pi
top - 04:03:38 up  3:30,  1 user,  load average: 0.00, 0.00, 0.00
Tasks: 166 total,   1 running, 165 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.2 us,  0.2 sy,  0.0 ni, 99.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :   7811.3 total,   6909.1 free,    284.0 used,    618.2 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.   7394.4 avail Mem

# lenovo
top - 04:03:54 up  1:45,  1 user,  load average: 0.07, 0.02, 0.00
Tasks: 197 total,   1 running, 196 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  0.5 sy,  0.0 ni, 99.5 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :  31587.8 total,  30665.4 free,    426.2 used,    496.3 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.  30758.7 avail Mem

ベストアンサー1

iw dev wlan0 get power_save戻ったら、閉じてiw dev wlan0 set power_save offもう一度やり直してください。再起動するたびにスリープモードに戻るので、デフォルトに設定する方法がわかりません。

おすすめ記事