第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

壓力測(cè)試工具ab的兩個(gè)Time per request 參數(shù)含義和區(qū)別

標(biāo)簽:
PHP Linux 測(cè)試

“老师,您好,我的问题如下:
关于ab测试结果中time per request 有两个展示项:
不过网上对这个参数的解释参差不齐,希望老师可以帮忙解惑下,有没有比较浅显的例子呢?”

有同学问题我这个问题,希望再详细点解释下:

1. 首先,介绍ab工具中,会出现两个Time per request ,如下:

$ ab -n 10 -c3 http://www.imoocc.com/
This is ApacheBench, Version 2.3 <$Revision: 1663405 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.imoocc.com (be patient).....done

Server Software: nginx/1.4.6
Server Hostname: www.imoocc.com
Server Port: 80

Document Path: /
Document Length: 0 bytes

Concurrency Level: 3
Time taken for tests: 1.093 seconds
Complete requests: 10
Failed requests: 0
Non-2xx responses: 10
Total transferred: 2300 bytes
HTML transferred: 0 bytes
Requests per second: 9.15 [#/sec] (mean)
Time per request: 328.016 [ms] (mean) //第一个
Time per request: 109.339 [ms] (mean, across all concurrent requests) //第二个
Transfer rate: 2.05 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 127 134 4.6 136 139
Processing: 132 140 6.0 139 149
Waiting: 132 139 5.9 139 147
Total: 259 274 9.2 276 285

Percentage of the requests served within a certain time (ms)
50% 276
66% 278
75% 282
80% 283
90% 285
95% 285
98% 285
99% 285
100% 285 (longest request)

2. 先说下第二个数值是怎么来的?
我们会发现第二个Time per request时间会短很多,对吧,首先我们需要了解Time taken for tests,它表示请求的总时间。上面的演示中,请求的总时间为:1093ms
(第二个)Time per request = Time taken for tests / Complete requests
那么为 1093ms/10 =109.339 [ms]

3.那么第一个Time per request是什么意思呢?
其实主要的区别在请求的时间上,第一个Time per request会计算每一个请求的请求和结束时间,注意区别在计算统计每一个请求。
举个例子:
我们并发请求3个,分别每个请求的时间为30ms、40ms 、50ms ,总共并发完成的时间为90ms,那么:
(第二个)Time per request = 90ms /3 = 30ms
(第一个) Time per request = (30ms + 40ms + 50ms) /3 = 40ms

这么描述,大家应该好明白吧,两个时间都可以看出每一次请求的耗时,只是分析的维度不一样,第一个的总共时间是累计的每一次请求的时间和。

點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
Python工程師
手記
粉絲
2萬
獲贊與收藏
3371

關(guān)注作者,訂閱最新文章

閱讀免費(fèi)教程

  • 推薦
  • 評(píng)論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評(píng)論
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消