linux下使用httping測試web回應時間

來源:互聯網
上載者:User

標籤:lnmp

安裝httping

yum -y install httping

然後使用:

httping -options

-g url

-h hostname

-p port

-x host:port(如果是測squid,用-x,不要用-h;和curl的不一樣,curl -H指定的是發送的hostname,這個-h是指定給DNS解析的hostname)

-c count

-t timeout

-s statuscode

-S 將時間分開成串連和傳輸兩部分顯示

-G GET(預設是HEAD)

-b 在使用了GET的前提下顯示傳輸速度KB/s

-B 同-b,不過使用了壓縮

-I useragent

-R referer

-C cookie=*

-l SSL

-U username

-P password

-n a,b 提供給nagios監控用的,當平均回應時間>=a時,返回1;>=b,返回2;預設為0

-N c 提供給nagios監控用的,一切正常返回0,否則只要有失敗的就返回c

舉例如下:

[[email protected] ~]# httping -g http://www.baidu.com -SGbs -c 10

PING www.baidu.com:80 (/):

connected to 220.181.112.244:80 (593 bytes), seq=0 time=375.32+  5.69+  6.21+ 19.39+  0.01=406.62 ms 200 OK 4079KB/s

connected to 220.181.111.188:80 (593 bytes), seq=1 time=385.49+  5.55+  6.31+ 23.69+  0.01=421.05 ms 200 OK 3316KB/s

connected to 220.181.112.244:80 (593 bytes), seq=2 time=368.88+  5.37+  5.68+ 13.65+  0.01=393.58 ms 200 OK 5987KB/s

connected to 220.181.111.188:80 (593 bytes), seq=3 time=371.23+  5.22+  5.67+ 24.77+  0.01=406.88 ms 200 OK 3106KB/s

connected to 220.181.111.188:80 (593 bytes), seq=4 time=378.27+  5.29+  5.68+ 14.14+  0.01=403.38 ms 200 OK 6408KB/s

connected to 220.181.112.244:80 (593 bytes), seq=5 time=381.77+  5.17+  5.69+ 18.68+  0.01=411.32 ms 200 OK 4208KB/s

connected to 220.181.111.188:80 (593 bytes), seq=6 time=386.37+  5.08+  5.71+ 21.32+  0.02=418.48 ms 200 OK 4110KB/s

connected to 220.181.111.188:80 (593 bytes), seq=7 time=389.38+  5.52+  5.57+ 18.96+  0.01=419.44 ms 200 OK 4217KB/s

connected to 220.181.111.188:80 (593 bytes), seq=8 time=403.63+  5.29+  5.64+ 24.81+  0.01=439.37 ms 200 OK 3271KB/s

connected to 220.181.112.244:80 (593 bytes), seq=9 time=389.84+  5.21+  5.65+ 19.77+  0.01=420.46 ms 200 OK 4597KB/s

--- http://www.baidu.com/ ping statistics ---

10 connects, 10 ok, 0.00% failed, time 14142ms

round-trip min/avg/max = 393.6/414.1/439.4 ms

Transfer speed: min/avg/max = 3106.659816/4330.607617/6408.417735 KB


本文出自 “營運之家(Q群:1991706)” 部落格,請務必保留此出處http://304076020.blog.51cto.com/7503470/1562511

linux下使用httping測試web回應時間

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.