Files
SamWaf/docs/性能测试结果.md
2024-08-27 14:54:30 +08:00

4.0 KiB
Raw Permalink Blame History

访问压测结果

压测使用 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.0false
 keepalivefalse
 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条进行一次分库我们也可以在配置参数里面自行调整