while true;do curl -w "%{time_namelookup} %{time_connect} %{time_appconnect} %{time_pretransfer} %{time_starttransfer}" -4 -o /dev/null -s http://shinan.westarcloud.net/ >> ipv4.log && echo " " $(date)>>ipv4.log && sleep 1;done
curl加上 -4,只考虑ipv4,ipv6暂时忽略 等了大概几分钟
[root@179 ~]# wc -l ipv4.log
286 ipv4.log
[root@179 ~]# awk '$5>1' aaa_ipv4.log
5.516 5.543 0.000 5.543 5.616 2021年 01月 21日 星期四 13:53:11 CST
5.515 5.535 0.000 5.535 5.601 2021年 01月 21日 星期四 13:54:35 CST
5.515 5.542 0.000 5.542 5.616 2021年 01月 21日 星期四 13:59:31 CST
5.516 5.540 0.000 5.540 5.612 2021年 01月 21日 星期四 14:05:06 CST
发现都是DNS解析超时引起的
对DNS解析进行抓包:
tcpdump -i eth0 -n -s 500 --time-stamp-precision nano port 53 >> tcp_dump_ipv4.log
13:53:05.664839317 IP 192.168.9.179.53790 > 114.114.114.114.domain: 3317+ A? shinan.westarcloud.net. (40)
13:53:10.670069312 IP 192.168.9.179.53790 > 114.114.114.114.domain: 3317+ A? shinan.westarcloud.net. (40)
13:53:10.689162951 IP 114.114.114.114.domain > 192.168.9.179.53790: 3317 3/0/0 CNAME alb-kxy91hoib1swkvl6nz.cn-shanghai.alb.aliyuncs.com., A 101.132.179.150, A 106.14.217.150 (137)
13:54:29.961302184 IP 192.168.9.179.42618 > 114.114.114.114.domain: 18463+ A? shinan.westarcloud.net. (40)
13:54:34.966533222 IP 192.168.9.179.42618 > 114.114.114.114.domain: 18463+ A? shinan.westarcloud.net. (40)
13:54:34.984859803 IP 114.114.114.114.domain > 192.168.9.179.42618: 18463 3/0/0 CNAME alb-kxy91hoib1swkvl6nz.cn-shanghai.alb.aliyuncs.com., A 106.14.217.150, A 101.132.179.150 (137)
13:59:25.707143621 IP 192.168.9.179.48609 > 114.114.114.114.domain: 6714+ A? shinan.westarcloud.net. (40)
13:59:30.710874512 IP 192.168.9.179.48609 > 114.114.114.114.domain: 6714+ A? shinan.westarcloud.net. (40)
13:59:30.736171830 IP 114.114.114.114.domain > 192.168.9.179.48609: 6714 3/0/0 CNAME alb-kxy91hoib1swkvl6nz.cn-shanghai.alb.aliyuncs.com., A 101.132.179.150, A 106.14.217.150 (137)
原来都是DNS解析失败,然后重试导致的。。