使用wget检测web服务网络情况

2017/06/01 linux

如何检测站点访问网络情况

** curl -w **

新建一个 curl-format.txt 文件,内容如下:

\n
			time_namelookup:  %{time_namelookup}\n
			   time_connect:  %{time_connect}\n
			time_appconnect:  %{time_appconnect}\n
		   time_pretransfer:  %{time_pretransfer}\n
			  time_redirect:  %{time_redirect}\n
		 time_starttransfer:  %{time_starttransfer}\n
							----------\n
				 time_total:  %{time_total}\n
\n

执行curl -w命令

# curl -w "@curl-format.txt" -o /dev/null -s http://ivr.baidu.com

        time_namelookup:  0.026
           time_connect:  0.028
        time_appconnect:  0.000
       time_pretransfer:  0.028
          time_redirect:  0.000
     time_starttransfer:  8.626
                        ----------
             time_total:  8.738

参数说明

  • -w:按照后面的格式写出rt
  • time_namelookup:DNS 解析域名[www.taobao.com]的时间
  • time_commect:client和server端建立TCP 连接的时间
  • time_starttransfer:从client发出请求;到web的server 响应第一个字节的时间
  • time_total:client发出请求;到web的server发送会所有的相应数据的时间
  • speed_download:下周速度 单位 byte/s

绑定host测试单台

curl -w "@curl-format.txt" -o /dev/null -H "Host: news.91.com" http://10.199.130.25:80/android/s591112577126.html

Search

    Table of Contents