Ubuntu16.04ab安裝以及使用教程-創(chuàng)新互聯(lián)

  1. sudo apt-get install apache2-utils

    創(chuàng)新互聯(lián)長期為成百上千家客戶提供的網(wǎng)站建設(shè)服務(wù),團(tuán)隊(duì)從業(yè)經(jīng)驗(yàn)10年,關(guān)注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為南沙企業(yè)提供專業(yè)的網(wǎng)站建設(shè)、成都網(wǎng)站設(shè)計(jì),南沙網(wǎng)站改版等技術(shù)服務(wù)。擁有10余年豐富建站經(jīng)驗(yàn)和眾多成功案例,為您定制開發(fā)。

安裝ab

2.ab -n 10000 -c 100 https://www.baidu.com/

壓力測試www.baidu.com的http訪問性能

-n 10000 總共請求數(shù)10000

-c 100個(gè)并發(fā)線程同時(shí)訪問

性能測試報(bào)告如下:

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.baidu.com (be patient)

Completed 1000 requests

Completed 2000 requests

Completed 3000 requests

Completed 4000 requests

Completed 5000 requests

Completed 6000 requests

Completed 7000 requests

Completed 8000 requests

Completed 9000 requests

Completed 10000 requests

Finished 10000 requests

Server Software:     bfe/1.0.8.18

Server Hostname:     www.baidu.com

Server Port:       443

SSL/TLS Protocol:    TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128

Document Path:      /

Document Length:     227 bytes

Concurrency Level:    100

Time taken for tests:  30.201 seconds

Complete requests:    10000

Failed requests:     0

Total transferred:    10326740 bytes

HTML transferred:    2270000 bytes

Requests per second:   331.12 [#/sec] (mean)

Time per request:    302.008 [ms] (mean)

Time per request:    3.020 [ms] (mean, across all concurrent requests)

Transfer rate:      333.92 [Kbytes/sec] received

Connection Times (ms)

       min  mean[+/-sd] median  max

Connect:    20  255 626.4   33  15054

Processing:   7  33  82.0   10   1897

Waiting:     0  32  81.6   10   1895

Total:     27  288 635.1   50  15272

Percentage of the requests served within a certain time (ms)

 50%   50

 66%   241

 75%   257

 80%   293

 90%  1027

 95%  1056

 98%  2030

 99%  2060

 100%  15272 (longest request)

3.測試某個(gè)POST請求性能

ab -n 10000 -c 100 -p postfile -m POST localhost:8080/DealerProxySrv/DealerProxySrv/RHPCFollow

-n 10000 總共請求數(shù)10000

-c 100個(gè)并發(fā)線程同時(shí)請求

-p postfile

root@ubuntu:~/code# cat postfile

{

  "TraderId": "200030258",

  "TBrokerId": 1,

  "CustomerId": "200027977",

  "CBrokerId": 1,

  "Strategy": 1,

  "Size": 1,

  "Direction": 1

}

-m POST,method為POST

性能測試報(bào)告如下:

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)

Completed 1000 requests

Completed 2000 requests

Completed 3000 requests

Completed 4000 requests

Completed 5000 requests

Completed 6000 requests

Completed 7000 requests

Completed 8000 requests

Completed 9000 requests

Completed 10000 requests

Finished 10000 requests

Server Software:

Server Hostname:     localhost

Server Port:       8080

Document Path:      /DealerProxySrv/DealerProxySrv/RHPCFollow

Document Length:     113 bytes

Concurrency Level:    100

Time taken for tests:  122.149 seconds

Complete requests:    10000

Failed requests:     0

Total transferred:    2450000 bytes

Total body sent:     3270000

HTML transferred:    1130000 bytes

Requests per second:   81.87 [#/sec] (mean)

Time per request:    1221.487 [ms] (mean)

Time per request:    12.215 [ms] (mean, across all concurrent requests)

Transfer rate:      19.59 [Kbytes/sec] received

            26.14 kb/s sent

            45.73 kb/s total

Connection Times (ms)

       min  mean[+/-sd] median  max

Connect:     0   0  0.8    0    26

Processing:   46 1216 184.4  1206   2428

Waiting:    46 1216 184.4  1206   2428

Total:     52 1216 184.2  1206   2428

Percentage of the requests served within a certain time (ms)

 50%  1206

 66%  1261

 75%  1300

 80%  1323

 90%  1391

 95%  1457

 98%  1599

 99%  1995

 100%  2428 (longest request)

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

分享文章:Ubuntu16.04ab安裝以及使用教程-創(chuàng)新互聯(lián)
標(biāo)題URL:http://bm7419.com/article18/ceopgp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站排名、Google營銷型網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)公司、定制網(wǎng)站、網(wǎng)站策劃

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運(yùn)營