I have multiple RPIs winning Arch. Recently, I have noticed very slow ping response. It is not the ping times, which are actually fine, it is the first response to the request which seems to take a while on the RPI.
RPI strace on ping
$this->bbcode_second_pass_code('', '# strace -e trace=open -f ping -c2 bbc.co.uk
PING bbc.co.uk (151.101.192.81) 56(84) bytes of data.
64 bytes from 151.101.192.81 (151.101.192.81): icmp_seq=1 ttl=57 time=12.7 ms
64 bytes from 151.101.192.81 (151.101.192.81): icmp_seq=2 ttl=57 time=12.4 ms
--- bbc.co.uk ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 7877ms
rtt min/avg/max/mdev = 12.415/12.577/12.740/0.162 ms
+++ exited with 0 +++')
My ping response time is pretty good at 12ms from the USA, but the time required to get this is 7877ms! It takes almost 8 seconds to get the response. The IP address shows up almost immediately on the cli, but it takes a long time to get the response. Local lookups even mDNS is snappy. Some DNS lookups are quick but others are slow like the bbc.
If I do the same thing but with the IP address, it is fast:
$this->bbcode_second_pass_code('', '# strace -e trace=open -f ping -c2 151.101.64.81
PING 151.101.64.81 (151.101.64.81) 56(84) bytes of data.
64 bytes from 151.101.64.81: icmp_seq=1 ttl=57 time=12.5 ms
64 bytes from 151.101.64.81: icmp_seq=2 ttl=57 time=12.1 ms
--- 151.101.64.81 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 12.083/12.303/12.523/0.220 ms
+++ exited with 0 +++')
Copmpare this to my Arch desktop running x64:
$this->bbcode_second_pass_code('', '
$ strace -e trace=open -f ping -c2 bbc.co.uk
PING bbc.co.uk (151.101.64.81) 56(84) bytes of data.
64 bytes from 151.101.64.81 (151.101.64.81): icmp_seq=1 ttl=57 time=16.0 ms
64 bytes from 151.101.64.81 (151.101.64.81): icmp_seq=2 ttl=57 time=24.0 ms
--- bbc.co.uk ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 16.019/20.010/24.001/3.991 ms
+++ exited with 0 +++')
My networking setup on the RPi:
Connman, Ethernet (no wifi), resolvectl is resolving all requests:
my nsswitch.conf hosts line is:
$this->bbcode_second_pass_code('', 'hosts: files resolve')
my /etc/resolv.conf is a link to /run/systemd/resolve/resolv.conf
I started looking at this as I have noticed that some processes which do lookups seem to be taking longer than normal which I thought was a problem with the program, but it looks like it may be a resolving issue...
Thanks for any help!
Keith