Files
im_server/docs/test/IM-allrich双机压测执行记录-20260927.md
T

81 lines
3.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# IM allrich 双机压测执行记录
日期:2026-09-27
## 1. 测试环境
| 项目 | 值 |
|---|---|
| 企业码 | `allrich` |
| 企业名称 | 大家一起发 |
| HTTP API | `https://api.118im.com` |
| WebSocket | `wss://api.118im.com/v0/channels` |
| API Key | 通过 `IM_API_KEY` 注入,不写入 Git |
| 测试验证码 | `123456`,仅测试环境使用 |
| 测试密码 | 通过 `IM_LOAD_PASSWORD` 注入,不写入 Git |
| 机器 A | 当前开发机,`192.168.1.135` |
| 机器 B | 另一台压测机,运行 `-machine b` |
`config.json`、`.env.test`、`manifest.json` 均被 Git 忽略。manifest 含 2000 个账号 Token,只能通过受控内网传输。
## 2. 数据准备结果
2026-09-27 已完成并通过硬校验:
- 账号:2000,机器 A/B 各 1000。
- 用户名:`lta0001-lta1000`、`ltb0001-ltb1000`。
- 测试手机号:A 使用配置前缀加 `0001-1000`,B 使用配置前缀加 `5001-6000`。
- 好友关系:1000 对,序号相同的 A/B 用户互为好友。
- P2P Topic:1000 个,全部写入 manifest。
- 测试群:1 个,成员数 2000,Topic 仅在 manifest 中保存,文档只记录哈希 `98372d54fe65`。
准备过程观察到注册和好友同意接口存在少量瞬时 500/404,100 人群邀请批次存在 502、超过 2 分钟及 `IDEMPOTENCY_IN_PROGRESS`。工具使用相同业务幂等键和退避重试后全部恢复;这些属于准备链路现象,不计入正式消息到达率。
## 3. 当前运行状态
| 项目 | 值 |
|---|---|
| Run ID | `p2p-20260927-01` |
| 场景 | `p2p` |
| Coordinator | `http://192.168.1.135:8090` |
| 机器 A agent | `1000/1000 READY`,意外断连 0 |
| 机器 B agent | 等待启动 |
| 远端 dev | `6d17154` 或更新版本 |
机器 A 的 coordinator 和 agent A 已运行。机器 B 启动并达到 1000 READY 后,coordinator 自动下发统一开始时间,无需人工再次触发。
## 4. 机器 B 运行文件
机器 A 已生成:
```text
/tmp/allrich-machine-b-runtime-p2p-20260927-01.tar.gz
SHA-256: ed22883856862e0ef8183cf14c4306d4569904400867cb2a236c3498e5c6f574
```
机器 B 必须先安全获取该文件,再执行:
```bash
git switch dev
git pull --ff-only origin dev
cd loadtest/im-pressure
tar -xzf /安全传输路径/allrich-machine-b-runtime-p2p-20260927-01.tar.gz
chmod 600 .env.test manifest.json
set -a; source .env.test; set +a
go build -o im-pressure .
./im-pressure agent \
-config config.json \
-manifest manifest.json \
-machine b \
-coordinator http://192.168.1.135:8090 \
-metrics-listen :9105 \
-output results/p2p-20260927-01/agent-b-summary.json
```
完整 B 机操作和故障处理见 [`loadtest/im-pressure/MACHINE-B.md`](../../loadtest/im-pressure/MACHINE-B.md)。
## 5. 多 Pod 口径说明
当前 A/B 配置均使用 `wss://api.118im.com/v0/channels` 公共入口。该配置验证 LB 实际分配下的多 Pod 能力,但不能保证两台压测机固定落到不同 Pod。若验收要求强制指定不同 Pod,需要提供两个独立 WS 定向入口,分别配置到 `endpoints.a` 和 `endpoints.b`。