服务端性能压测

tech2022-08-07  139

       最近在网上搜到一个不错的压缩程序代码,git地址是:https://github.com/link1st/go-stress-testing.git

[root@ads-adr-test go-stress-testing]# go run main.go -c 1000 -n 7 -u http://127.0.0.1:80/query -data "{\"category\":\"ad\",\"uid\":\"12\",\"keys\":[{\"master_key\":\"1111\"}]}" 开始启动 并发数:1000 请求数:7 请求参数: request: form:http url:http://127.0.0.1:80/query method:POST headers:map[Content-Type:application/x-www-form-urlencoded; charset=utf-8] data:{"category":"ad","uid":"12","keys":[{"master_key":"1111"}]} verify:statusCode timeout:30s debug:false ─────┬───────┬───────┬───────┬────────┬────────┬────────┬────────┬──────── 耗时│ 并发数│ 成功数│ 失败数│ qps │最长耗时│最短耗时│平均耗时│ 错误码 ─────┼───────┼───────┼───────┼────────┼────────┼────────┼────────┼──────── 1s│ 1000│ 2318│ 0│ 3081.14│ 514.55│ 116.96│ 0.32│200:2318 2s│ 1000│ 5584│ 0│ 3247.97│ 514.55│ 116.96│ 0.31│200:5584 2s│ 1000│ 7000│ 0│ 3432.34│ 514.55│ 61.94│ 0.29│200:7000 ************************* 结果 stat **************************** 处理协程数量: 1000 请求总数(并发数*请求数 -c * -n): 7000 总请求时间: 2.246 秒 successNum: 7000 failureNum: 0 ************************* 结果 end ****************************

可以指定并发数和请求数,qps和其他统计数据也很全面。

最新回复(0)