test(go): record 100k gateway connection baseline

This commit is contained in:
lingniu
2026-07-03 18:24:07 +08:00
parent 65232812a1
commit f8fbeb8936
3 changed files with 13 additions and 2 deletions

View File

@@ -129,12 +129,17 @@ go run ./cmd/load-sim \
| 100 连接 | `18:03:21-18:04:21 CST` | `connections=100 connect-rate=100 duration=60s send=false` | JT808 active `340``ss``341` | opened `100`failed `0`frames `0`write_errors `0` | load 约 `0.33/0.21/0.22`available memory 约 `6659 MB` |
| 1,000 连接 | `18:04:38-18:05:38 CST` | `connections=1000 connect-rate=500 duration=60s send=false` | JT808 active `1240``ss``1241`gateway FD 约 `1256` | opened `1000`failed `0`frames `0`write_errors `0` | load 约 `0.80/0.33/0.26`available memory 约 `6645 MB` |
| 10,000 连接 | `18:05:59-18:07:59 CST` | `connections=10000 connect-rate=1000 duration=120s send=false` | JT808 active `10240``ss``10241`gateway FD 约 `10256` | opened `10000`failed `0`frames `0`write_errors `0` | 20 秒时 load 约 `0.45/0.33/0.27`available memory 约 `6409 MB`NATS ack pending `0` |
| 50,000 连接 | `18:11:22-18:14:22 CST` | `connections=50000 connect-rate=2000 duration=180s send=false` | JT808 active `50238``ss``50239`gateway FD 约 `50254` | opened `50000`failed `0`frames `0`write_errors `0` | 45 秒时 load 约 `0.07/0.23/0.24`available memory 约 `5590 MB`NATS ack pending 短时 `29`,后续归零 |
| 100,000 总连接 | `18:18:13-18:21:13 CST` | JT808 `50000` + GB32960 `50000`,各 `connect-rate=2000 duration=180s send=false` | JT808 active `50236`GB32960 active `50002`,总 active 约 `100238`gateway FD 约 `100252` | JT808 opened `50000` / failed `0`GB32960 opened `50000` / failed `0`frames `0`write_errors `0` | 75 秒时 load 约 `0.16/0.30/0.29`available memory 约 `4511 MB`NATS ack pending 短时 `10`,后续归零 |
压测后:
- `2026-07-03 18:08:47 CST` JT808 active 回落到 `240``ss``241`
- `2026-07-03 18:15:36 CST` 5W 压测后 JT808 active 回落到约 `238``ss``239`
- `2026-07-03 18:16:49 CST` NATS ack pending 回到 `0`history/stat/realtime Kafka lag 总和均为 `0`
- `2026-07-03 18:23:02 CST` 10W 总连接压测后 JT808 active 回落到 `236`GB32960 active 回落到 `2`NATS ack pending 为 `0`history/stat/realtime Kafka lag 总和均为 `0`
- `20211/20212/20213/20214/20200` readyz 均 OK。
- 压测窗口未出现 gateway `error|failed|panic|fatal|rejected` 日志。
- `vehicle_gateway_connection_rejections_total` 未输出,表示本轮没有连接拒绝计数。
结论:单 ECS 已通过本机 1W JT808 hold-only 连接基线测试;下一阶段应跑 5W hold-only再进入带真实帧率的低 FPS 压测
结论:单 ECS 已通过本机 10W 总连接 hold-only 基线测试。该结果证明当前内核参数、gateway 连接上限和 systemd 文件句柄设置可以承载 10W 空闲长连接;下一阶段必须进入带真实帧率的低 FPS 压测验证解析、NATS、Kafka、Redis、TDengine、MySQL 全链路吞吐

View File

@@ -376,9 +376,15 @@ net.ipv4.tcp_tw_reuse = 1
| 100 连接 / 60s | opened `100`failed `0`frames `0`write_errors `0` |
| 1,000 连接 / 60s | opened `1000`failed `0`frames `0`write_errors `0` |
| 10,000 连接 / 120s | opened `10000`failed `0`frames `0`write_errors `0` |
| 50,000 连接 / 180s | opened `50000`failed `0`frames `0`write_errors `0` |
| 100,000 总连接 / 180s | JT808 opened `50000`、GB32960 opened `50000`failed `0`frames `0`write_errors `0` |
1W 阶段峰值约 `10240` JT808 active connectionsgateway FD 约 `10256`NATS ack pending 为 `0`,压测后连接回落到生产基线约 `240`readyz 全部 OK。
5W 阶段峰值约 `50238` JT808 active connectionsgateway FD 约 `50254`available memory 约 `5590 MB`。NATS ack pending 中间短时到 `29``18:16:49 CST` 回到 `0`history/stat/realtime Kafka lag 总和均为 `0`。压测后 JT808 active 回落到生产基线约 `238-240`readyz 全部 OK。
10W 总连接阶段使用双端口 loopbackJT808 `50000` + GB32960 `50000`,均 `-send=false`。峰值约 `100238` active connectionsgateway FD 约 `100252`available memory 约 `4511 MB`。NATS ack pending 中间短时到 `10``18:23:02 CST` 回到 `0`history/stat/realtime Kafka lag 总和均为 `0`。压测后 JT808 回落到约 `236`GB32960 回落到约 `2`readyz 全部 OK。
## 下次恢复上下文时先做
1. 读本文件。

View File

@@ -523,7 +523,7 @@ Record:
- connection rejection count
- errors
Actual: recorded 100 / 1,000 / 10,000 hold-only results in `docs/ops/100k-capacity-baseline.md`.
Actual: recorded 100 / 1,000 / 10,000 / 50,000 / 100,000 total hold-only results in `docs/ops/100k-capacity-baseline.md`.
- [ ] **Step 5: Commit**