wrk安装测试

社会主义新天地 提交于 2019-12-09 15:16:50

下载源码,编译

git clone https://github.com/wg/wrk.git  
cd wrk  
make
cp wrk /usr/local/bin/

编辑post.lua文件

[hdfs@xydwtest01 ~]$ cat  post.lua   
wrk.scheme = "http"
wrk.method = "POST"
wrk.path = "/safetycodec/algo/decode"
wrk.headers["Content-Type"] = "application/json"
wrk.body ='{"sid":778658278485754135,"serverName":"pro_stress_check","data":"eyJtb2JpbGVUZXN0XzMiOiJhbmQ1WTNGNlEycG5kRzVWYzBaMGNGbE1WRU5LUVQwOWMwWjJabmxsWld4U2FVTXJXa1Z3UjFreVpYTkRVbWwwTkVwR1FsTjFWa2xMWkZScUwyZFhhMUE1UlQwPSIsIm1vYmlsZVRlc3RfNCI6ImFuZDVZM0Y2UTJwbmRHNVZjMFowY0ZsTVZFTktRVDA5YzBaMlpubGxaV3hTYVVNcldrVndSMWt5WlhORFpqa3ZNazlqUlhOT1ZXeHVURzlLYlM5dlVqQnBiejA9IiwibW9iaWxlVGVzdF81IjoiYW5kNVkzRjZRMnBuZEc1VmMwWjBjRmxNVkVOS1FUMDljMFoyWm5sbFpXeFNhVU1yV2tWd1Ixa3laWE5EVVhCRlpFSTJaMEpDY0V0cU4yeHBLMUJTVTBGaFVUMD0iLCJtb2JpbGVUZXN0XzEiOiJhbmQ1WTNGNlEycG5kRzVWYzBaMGNGbE1WRU5LUVQwOWMwWjJabmxsWld4U2FVTXJXa1Z3UjFreVpYTkRXa0l4U0VOUVRXRlJPV0lyTnk5MGNHOUxZVFV6TUQwPSIsIm1vYmlsZVRlc3RfMiI6ImFuZDVZM0Y2UTJwbmRHNVZjMFowY0ZsTVZFTktRVDA5YzBaMlpubGxaV3hTYVVNcldrVndSMWt5WlhORFVYWXdSelJUWjFCUlkwTnJOeTlqYTNoVlJXSlNNRDA9In0=","sign":"CC6078CB78B7A16167E88AB6E126139C"}'

执行命令

 [hdfs@xydwtest01 ~]$ /usr/local/bin/wrk -t12 -c100 -d30s -T30s --script=post.lua --latency  http://10.0.121.55:2363
Running 30s test @ http://10.0.121.55:2363
  12 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    13.12ms    2.54ms  43.80ms   78.54%
    Req/Sec   613.00     50.19   750.00     70.14%
  Latency Distribution
     50%   12.79ms
     75%   14.22ms
     90%   15.83ms
     99%   22.69ms
  219773 requests in 30.02s, 95.99MB read
Requests/sec:   7320.81
Transfer/sec:      3.20MB

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!