中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

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

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

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

        一.webbench

        本文引用地址:http://www.antipu.com.cn/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個(gè)并發(fā)用戶共同請求5秒

        測試結(jié)果分析

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

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

        Speed=4296 pages/min, 38664 bytes/sec. #4296個(gè)頁面每秒,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個(gè)并發(fā)用戶共同請求個(gè)數(shù)500個(gè)。

        測試結(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 #測試消耗時(shí)間

        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) #每個(gè)請求平均等待時(shí)間Time per request: 13.504 [ms] (mean, across all concurrent requests) #服務(wù)器每個(gè)請求平均處理時(shí)間

        Transfer rate: 81.86 [Kbytes/sec] received #平均每秒流量數(shù)Connection Times (ms) #下面為時(shí)間花費(fèi)的分布(連接、處理、等待、總數(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//下面為每個(gè)請求花費(fèi)時(shí)間的分布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 #主要看這個(gè)參數(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é)果就不貼上來了,多了一個(gè)明顯的結(jié)果:

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



        關(guān)鍵詞:

        評論


        相關(guān)推薦

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

        關(guān)閉