美文网首页
网站 ttfb值非常大

网站 ttfb值非常大

作者: 疯言疯語 | 来源:发表于2021-01-21 14:34 被阅读0次

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解析失败,然后重试导致的。。

相关文章

  • 网站 ttfb值非常大

    while true;do curl -w "%{time_namelookup} %{time_connect}...

  • 首屏加载缓慢优化

    TTFB # 什么是 TTFB   TTFB,Time to First Byte 的缩写,又叫首字节响应时间。指...

  • TTFB 时间过长原因分析

    什么是 Waiting (TTFB) 时间 TTFB 是 Time to First Byte 的缩写,指的是浏览...

  • TTFB

    TTFB - Time To First Byte 第一字节响应时间,就是从发送请求到服务器,加上服务器处理请求并...

  • TTFB

    TTFB是“最初的网络请求被发起”到“从服务器接收到第一个字节前”所花费的毫秒数。 TTFB (Time To F...

  • TTFB

    什么是TTFB TTFB是发出页面请求到接收到应答数据第一个字节所花费的毫秒数 组成 浏览器开始收到服务器响应数据...

  • 解决ajax请求服务器(PHP端)响应时间过长问题

    title: 解决ajax请求服务器(PHP端)响应时间过长问题tags: [ajax,PHP,TTFB,请求时长...

  • 社交登录

    简介 微信,微博等网站的用户量非常大,别的网站为了简化自我网站的登陆与注册逻辑,引入社交登录的功能; 实现的步骤 ...

  • 性能优化探索

    性能优化指标 加载指标speedIndex速度指数:代表页面内容渲染所消耗的时间TTFB:是 Time to Fi...

  • 首屏性能优化

    1 前言 首屏的几个时间概念1.TTFB:time for First Byte 首字节时间2.FP:First ...

网友评论

      本文标题:网站 ttfb值非常大

      本文链接:https://www.haomeiwen.com/subject/jqzrzktx.html