mirror of
https://gitee.com/samwaf/SamWaf.git
synced 2025-12-06 06:58:54 +08:00
4.0 KiB
4.0 KiB
访问压测结果
压测使用 go-stress-testing(https://github.com/link1st/go-stress-testing)
命令 go-stress-testing-win -c 20 -n 1000 -u http://localhost
参数说明:
-c 表示并发数
-n 每个并发执行请求的次数,总请求的次数 = 并发数 * 每个并发执行请求的次数
-u 需要压测的地址
docker测试结果
目前测试可能受开发机(win10)环境问题, waf和web站点都是在docker里面,并发在2000会出现异常情况,有合适的机器我重新再跑一下,理论上不止这个数。
> go-stress-testing-win -c 2000 -n 1 -u http://localhost
开始启动 并发数:2000 请求数:1 请求参数:
request:
form:http
url:http://localhost
method:GET
headers:map[Content-Type:application/x-www-form-urlencoded; charset=utf-8]
data:
verify:statusCode
timeout:30s
debug:false
http2.0:false
keepalive:false
maxCon:1
─────┬───────┬───────┬───────┬────────┬────────┬────────┬────────┬────────┬────────┬────────
耗时│ 并发数│ 成功数│ 失败数│ qps │最长耗时│最短耗时│平均耗时│下载字节│字节每秒│ 状态码
─────┼───────┼───────┼───────┼────────┼────────┼────────┼────────┼────────┼────────┼────────
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": read tcp [::1]:59773->[::1]:80: wsarecv: An existing connection was forcibly closed by the remote host.
请求失败: Get "http://localhost": read tcp [::1]:59774->[::1]:80: wsarecv: An existing connection was forcibly closed by the remote host.
请求失败: Get "http://localhost": read tcp [::1]:59375->[::1]:80: wsarecv: An existing connection was forcibly closed by the remote host.
请求失败: Get "http://localhost": read tcp [::1]:59772->[::1]:80: wsarecv: An existing connection was forcibly closed by the remote host.
请求失败: Get "http://localhost": read tcp [::1]:59764->[::1]:80: wsarecv: An existing connection was forcibly closed by the remote host.
请求失败: Get "http://localhost": read tcp [::1]:59763->[::1]:80: wsarecv: An existing connection was forcibly closed by the remote host.
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
请求失败: Get "http://localhost": EOF
1s│ 1310│ 1284│ 26│ 2943.85│ 985.88│ 297.53│ 679.38│ 789,660│ 789,087│200:1284;509:26
1s│ 2000│ 1974│ 26│ 2411.24│ 1257.35│ 297.53│ 829.45│1,214,010│ 936,392│200:1974;509:26
************************* 结果 stat ****************************
处理协程数量: 2000
请求总数(并发数*请求数 -c * -n): 2000 总请求时间: 1.296 秒 successNum: 1974 failureNum: 26
tp90: 1168.000
tp95: 1209.000
tp99: 1244.000
************************* 结果 end ****************************
todo: 搭建linux可以支撑 搭建winServer可以支持
日志处理
SamWaf针对日志会采取分库策略,默认是100W条进行一次分库,我们也可以在配置参数里面自行调整