Hello stackoverflow community, I'd like to get help to understand what causes ping to be slow
(This is copied from Stackoverflow following to an advice I've got there)
context
- I have two linux servers.
- rasberry pi 4
- kernel is
5.4.0-1042-raspi
- Lenovo n75q tiny gen2
- kernel is
5.4.0-89-generic
- They have an identical
/etc/netplan/99_config.yaml
file, and belongs to the same wifi network - They both are connected with the Internet, and they can retrieve contents from outer wolld. (I mean curl works in both servers)
- Their cpu are not busy, and they have enough mem.
problem
- When accessing to the second server(Lenovo) via ssh, its response is very laggy. (every single typing is laggy)
- However, it has better bandwidth than rasberry pi.
- The only curious fact I've found throw investigation on this is, ping to lenovo is slower than to rasberry pi.
- rasberry pi works/responds very smoothly.
question
- What can be the reason why lenovo is laggy when accessing to it via ssh?
- (If the reason is the same as the reason why ping is slow, ) how can I address to fix this issue?
result of iperf
# 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
result of speedtest
# 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
result of 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
result of traceroute
# 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
result of top
# 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
ip link
. WiFi MTUs must be 1492, not 1500.wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
. let me observe what will happen if it's set as 1492iw dev wlan0 get power_save
returns on, then set it off withiw dev wlan0 set power_save off
and retry.