在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > linux中給應(yīng)用做壓力測試

            linux中給應(yīng)用做壓力測試

            作者: 時間:2016-09-12 來源:網(wǎng)絡(luò) 收藏

            一.webbench

            本文引用地址:http://www.biyoush.com/article/201609/303426.htm

            在Ubuntu中安裝webbench —支持get,head等請求,但不支持post請求

            wget http://blog.zyan.cc/soft/linux/webbench/webbench-1.5.tar.gztar zxvf webbench-1.5.tar.gzcd webbench-1.5make make install

            測試demo

            webbench -t 5 -c 2 http://google.com/ >2個并發(fā)用戶共同請求5秒

            測試結(jié)果分析

            Benchmarking: GET http://google.com/ #GET方法請求谷歌

            2 clients, running 5 sec. #2個用戶,運(yùn)行5秒

            Speed=4296 pages/min, 38664 bytes/sec. #4296個頁面每秒,38664 bytes每秒

            Requests: 358 susceed, 0 failed. #358次請求成功,0次失敗

            二. ab

            在Ubuntu中安裝ab —支持 post ,get ,head 等方法

            sudo apt-get install apache2-util

            測試demo

            ab -n 500 -c 2 http://www.google.com/ >2個并發(fā)用戶共同請求個數(shù)500個。

            測試結(jié)果分析

            Server Software: gws #服務(wù)器信息

            Server Hostname: www.google.com #測試地址

            Server Port: 80 #測試端口

            Document Path: / #測試文檔路徑

            Document Length: 390 bytes #測試文檔大小

            Concurrency Level: 2 #并發(fā)數(shù)量

            Time taken for tests: 6.752 seconds #測試消耗時間

            Complete requests: 500 #完成的請求數(shù)

            Failed requests: 0 #失敗的請求數(shù)

            Non-2xx responses: 500 #HTTP響應(yīng)數(shù)據(jù)的頭信息中含有2XX以外的狀態(tài)碼的請求數(shù)

            Total transferred: 566000 bytes #總傳輸數(shù)據(jù)大小HTML transferred: 195000 bytes #總傳輸html數(shù)據(jù)大小Requests per second: 74.05 [#/sec] (mean) #吞吐量,每秒處理平均請求數(shù)Time per request: 27.007 [ms] (mean) #每個請求平均等待時間Time per request: 13.504 [ms] (mean, across all concurrent requests) #服務(wù)器每個請求平均處理時間

            Transfer rate: 81.86 [Kbytes/sec] received #平均每秒流量數(shù)Connection Times (ms) #下面為時間花費的分布(連接、處理、等待、總數(shù))

            min mean[+/-sd] median max

            Connect: 1 1 0.2 1 2

            Processing: 22 26 7.6 25 150

            Waiting: 22 26 7.6 25 150

            Total: 23 27 7.6 26 151//下面為每個請求花費時間的分布Percentage of the requests served within a certain time (ms)50% 26 #50%在26毫秒之內(nèi)

            66% 27 #66%在27毫秒之內(nèi)

            75% 27

            80% 27

            90% 28 #主要看這個參數(shù),90%在28毫秒之內(nèi)

            95% 29

            98% 36

            99% 52

            100% 151 (longest request)

            如想在請求header加入數(shù)據(jù),如下:

            ab -H Cookie: key=value;key2=value2 ...

            4.利用ab 進(jìn)行post請求

            ab -c 1 -n 100 -T 'application/json' -p data.json http://www.google.com/

            測試結(jié)果就不貼上來了,多了一個明顯的結(jié)果:

            Total body sent: 15900 #body總的發(fā)送量



            關(guān)鍵詞:

            評論


            相關(guān)推薦

            技術(shù)專區(qū)

            關(guān)閉