ABtest 性能測試

ABtest 性能測試

ab 模擬 get 性能測試:

-n 請求次數(shù)
-c 請求線程數(shù)
最后是路徑

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

This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
m
Benchmarkinghttp://127.0.0.1:8002/webapi/ (be patient).....done

Server Software:        nginx/1.6.0
Server Hostname:        teststaff.91jinrong.com
Server Port:            443
SSL/TLS Protocol:       TLSv1/SSLv3,ECDHE-RSA-AES128-GCM-SHA256,2048,128

Document Path:          /api/permission_list?username=xueshi123&subsystem=WALLET
Document Length:        63136 bytes

Concurrency Level:      10
Time taken for tests:   69.852 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      6344900 bytes
HTML transferred:       6313600 bytes
Requests per second:    1.43 [#/sec] (mean)
Time per request:       6985.199 [ms] (mean)
Time per request:       698.520 [ms] (mean, across all concurrent requests)
Transfer rate:          88.70 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       24   59  45.7     40     267
Processing:   855 6721 1103.0   6807    8034
Waiting:      694 6418 966.7   6696    7196
Total:        898 6779 1111.2   6832    8125

Percentage of the requests served within a certain time (ms)
  50%   6832
  66%   7108
  75%   7608
  80%   7812
  90%   7950
  95%   8077
  98%   8124
  99%   8125
 100%   8125 (longest request)

  Concurrency Level: 并發(fā)級別

  Time taken for tests :測試消耗時間 seconds/秒
  Time taken for tests:    s

-----------------------------------------------------------------------------------------------------

ab test 模擬 post data 壓測接口性能

ab

-n 請求次數(shù)
-c 請求線程數(shù)
-p 請求參數(shù)文件屎媳,文件格式: post_loc.txt
-T 請求數(shù)據(jù)類型 application/x-www-form-urlencoded 表單提交

cd /tmp
vim post_loc.txt

businessLine=qianbao&uname=714758616345&name=1jHFu3F6&cardId=A4tlZ8nWSY78niYa00iVGA6Q&gt18=true


發(fā)起測試接口

ab -p post_loc.txt  -T application/x-www-form-urlencoded   -H 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8' -H 'Accept: application/json'  -c 10 -n 100 http://127.0.0.1:8002/webapi/
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/

Benchmarkinghttp://127.0.0.1:8002/webapi/ (be patient).....done


Server Software:        nginx
Server Hostname:        http://127.0.0.1:8002/webapi/
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES256-GCM-SHA384,2048,256

Document Path:          http://127.0.0.1:8002/webapi/
Document Length:        100 bytes

Concurrency Level:      10
Time taken for tests:   1.218 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      43000 bytes
Total body sent:        35500
HTML transferred:       10000 bytes
Requests per second:    82.10 [#/sec] (mean)
Time per request:       121.797 [ms] (mean)
Time per request:       12.180 [ms] (mean, across all concurrent requests)
Transfer rate:          34.48 [Kbytes/sec] received
                        28.46 kb/s sent
                        62.94 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       55   82  13.7     82     119
Processing:    17   35  12.0     33      66
Waiting:       17   33  11.2     31      66
Total:         87  117  13.9    116     159

Percentage of the requests served within a certain time (ms)
  50%    116
  66%    121
  75%    126
  80%    128
  90%    137
  95%    143
  98%    148
  99%    159
 100%    159 (longest request)

-----------------------------------------------------------------------------------------------------

ab test 模擬 post json 壓測接口性能

-n 請求次數(shù)
-c 請求線程數(shù)
-p 請求參數(shù)文件脚曾,文件格式: post_loc.txt
-T 請求數(shù)據(jù)類型 application/json json格式提交

ab -n 200 -c 10  -T 'application/json' -p post.json http://127.0.0.1:8002/webapi/

post.json

{
    "jsonrpc": "2.0",
    "method": "test_method",
    "params": [1442885518, 1442892718,"testDomain_80"],
    "id": "1"
}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末跪帝,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子卵洗,更是在濱河造成了極大的恐慌,老刑警劉巖喉磁,帶你破解...
    沈念sama閱讀 216,843評論 6 502
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件锁孟,死亡現(xiàn)場離奇詭異,居然都是意外死亡仿贬,警方通過查閱死者的電腦和手機纽竣,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,538評論 3 392
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來诅蝶,“玉大人退个,你說我怎么就攤上這事〉骶妫” “怎么了?”我有些...
    開封第一講書人閱讀 163,187評論 0 353
  • 文/不壞的土叔 我叫張陵舱馅,是天一觀的道長缰泡。 經(jīng)常有香客問我,道長代嗤,這世上最難降的妖魔是什么棘钞? 我笑而不...
    開封第一講書人閱讀 58,264評論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮干毅,結(jié)果婚禮上宜猜,老公的妹妹穿的比我還像新娘。我一直安慰自己硝逢,他們只是感情好姨拥,可當我...
    茶點故事閱讀 67,289評論 6 390
  • 文/花漫 我一把揭開白布绅喉。 她就那樣靜靜地躺著,像睡著了一般叫乌。 火紅的嫁衣襯著肌膚如雪柴罐。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,231評論 1 299
  • 那天憨奸,我揣著相機與錄音革屠,去河邊找鬼。 笑死排宰,一個胖子當著我的面吹牛似芝,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播板甘,決...
    沈念sama閱讀 40,116評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼党瓮,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了虾啦?” 一聲冷哼從身側(cè)響起麻诀,我...
    開封第一講書人閱讀 38,945評論 0 275
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎傲醉,沒想到半個月后蝇闭,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,367評論 1 313
  • 正文 獨居荒郊野嶺守林人離奇死亡硬毕,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,581評論 2 333
  • 正文 我和宋清朗相戀三年呻引,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片吐咳。...
    茶點故事閱讀 39,754評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡逻悠,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出韭脊,到底是詐尸還是另有隱情童谒,我是刑警寧澤,帶...
    沈念sama閱讀 35,458評論 5 344
  • 正文 年R本政府宣布沪羔,位于F島的核電站饥伊,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏蔫饰。R本人自食惡果不足惜琅豆,卻給世界環(huán)境...
    茶點故事閱讀 41,068評論 3 327
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望篓吁。 院中可真熱鬧茫因,春花似錦、人聲如沸杖剪。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,692評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至翼雀,卻和暖如春饱苟,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背狼渊。 一陣腳步聲響...
    開封第一講書人閱讀 32,842評論 1 269
  • 我被黑心中介騙來泰國打工箱熬, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人狈邑。 一個月前我還...
    沈念sama閱讀 47,797評論 2 369
  • 正文 我出身青樓城须,卻偏偏與公主長得像,于是被迫代替她去往敵國和親米苹。 傳聞我的和親對象是個殘疾皇子糕伐,可洞房花燭夜當晚...
    茶點故事閱讀 44,654評論 2 354

推薦閱讀更多精彩內(nèi)容

  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理,服務發(fā)現(xiàn)蘸嘶,斷路器良瞧,智...
    卡卡羅2017閱讀 134,652評論 18 139
  • 1. Java基礎部分 基礎部分的順序:基本語法,類相關(guān)的語法训唱,內(nèi)部類的語法褥蚯,繼承相關(guān)的語法,異常的語法况增,線程的語...
    子非魚_t_閱讀 31,625評論 18 399
  • 紅塵中 尋尋覓覓 碾轉(zhuǎn)幾春秋 情難舍 蹉跎歲月 愛恨又幾回 誰在輕嘆 一生等待 空等一春又一春的年華 桃花開 夏...
    想飛的魚521314閱讀 514評論 1 3
  • 晚上回到家赞庶,媽媽做了小魚最愛吃的番茄圓子湯。飯桌上澳骤,小魚整整齊齊擺放好了碗筷歧强,等待著爸爸回家。小魚的爸爸在市里一...
    明媚而憂傷的你閱讀 130評論 0 0
  • 想你为肮,你卻不在我身邊摊册。 想你的時候,何止一句我想你颊艳。我想見你丧靡,帶你跨過河流,欣賞山川籽暇,踏過草原,嗅嗅草地的芬芳饭庞,...
    凌獵閱讀 174評論 0 0