压测

go-wrk

安装

go get github.com/adeven/go-wrk

参数

-H="User-Agent: go-wrk 0.1 bechmark
Content-Type: text/html;": 由'
'分隔的请求头
-c=100: 使用的最大连接数
-k=true: 是否禁用keep-alives
-i=false: if TLS security checks are disabled
-m="GET": HTTP请求方法
-n=1000: 请求总数
-t=1: 使用的线程数
-b="" HTTP请求体
-s="" 如果指定,它将计算响应中包含搜索到的字符串s的频率

测试

go-wrk -t=8 -c=100 -n=10000 "http://127.0.0.1:8080/"
原文地址:https://www.cnblogs.com/huay/p/14727774.html