From f8fbeb8936e5f4b346fc647737f79ca9e54acbb4 Mon Sep 17 00:00:00 2001 From: lingniu Date: Fri, 3 Jul 2026 18:24:07 +0800 Subject: [PATCH] test(go): record 100k gateway connection baseline --- docs/ops/100k-capacity-baseline.md | 7 ++++++- docs/ops/go-vehicle-ingest-memory.md | 6 ++++++ .../plans/2026-07-03-100k-vehicle-ingest-hardening.md | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/ops/100k-capacity-baseline.md b/docs/ops/100k-capacity-baseline.md index 0b1cfd2e..81416022 100644 --- a/docs/ops/100k-capacity-baseline.md +++ b/docs/ops/100k-capacity-baseline.md @@ -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 全链路吞吐。 diff --git a/docs/ops/go-vehicle-ingest-memory.md b/docs/ops/go-vehicle-ingest-memory.md index b866baf1..5b9f18f5 100644 --- a/docs/ops/go-vehicle-ingest-memory.md +++ b/docs/ops/go-vehicle-ingest-memory.md @@ -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 connections,gateway FD 约 `10256`,NATS ack pending 为 `0`,压测后连接回落到生产基线约 `240`,readyz 全部 OK。 +5W 阶段峰值约 `50238` JT808 active connections,gateway 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 总连接阶段使用双端口 loopback:JT808 `50000` + GB32960 `50000`,均 `-send=false`。峰值约 `100238` active connections,gateway 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. 读本文件。 diff --git a/docs/superpowers/plans/2026-07-03-100k-vehicle-ingest-hardening.md b/docs/superpowers/plans/2026-07-03-100k-vehicle-ingest-hardening.md index 13925f57..01095f57 100644 --- a/docs/superpowers/plans/2026-07-03-100k-vehicle-ingest-hardening.md +++ b/docs/superpowers/plans/2026-07-03-100k-vehicle-ingest-hardening.md @@ -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**