2026-07-16 · 10.2.144.147 · medium · mock-perf · sustain 1800s · 采样 10s(折线降采样 ~30s)
本次压测验证的是「中型分析 Agent + K8s 沙箱 + 4 分片 LangGraph」在 C=32 稳态 30 分钟下的 infra 容量,不是真实 Kimi 语义质量。单用户仅 1 条 prompt,Agent 内部约 3 轮 Mock LLM(write_file → present_files → final)。完整成功率 99.6%,成功路径延迟集中在 220–270s;资源头room 充足。Sandbox 容器采样峰 4 / 均 2.28,低于 active_run≈32,属懒加载 + 短占用窗口下的预期现象(见第二节说明),不能据此判定沙箱容量不足。
「场景」= Agent 帮用户做什么 + 对话轮次 + Mock 大模型每轮输入输出(非 Gateway HTTP 路径)
模拟中型数据分析交付:用户一次性下达分析任务(检索/整理宏观或商品价格数据),要求 Agent 调用沙箱工具生成 Excel/Markdown 并 present_files 交付。压测使用 mock-perf 模型,不调用真实 Kimi。
典型 prompt(轮换 4 种模板,见 dialogue_workloads.py):
| # | 业务描述 |
|---|---|
| 1 | 国际金价一周走势 → Excel + present_files |
| 2 | 中国 GDP 年度数据 → Excel + present_files |
| 3 | 铜价月趋势 → xlsx + md 双文件 + present_files |
| 4 | GDP 多指标 → Excel + present_files |
| 步骤 | 角色 | 动作 | 说明 | LLM 次数 |
|---|---|---|---|---|
| 1 | 压测客户端 | POST /threads → POST /runs/wait | 1 条用户 prompt | — |
| 2 | Agent / LangGraph | 模型 → 工具 → … | ReAct 循环 | ≈3 次 LLM |
| 3 | Mock LLM #1 | tool_calls write_file | sleep ≈40s | 1 |
| 4 | Sandbox | write_file | 真实 K8s 沙箱 | — |
| 5 | Mock LLM #2 | tool_calls present_files | sleep ≈40s | 1 |
| 6 | 交付 | present_files | 不强制占 Pod | — |
| 7 | Mock LLM #3 | final 文本 | sleep ≈40s | 1 |
用户对话轮次 = 1。Agent 内部 LLM 轮次 ≈ 3(write_file → present_files → final)。总 wall time ≈ 3×40s LLM + 工具/调度开销。
mock_openai_llm.py · medium_script · 147:18080 · workers=32 · per_round=40s · max_inflight=32
| 项 | 值 |
|---|---|
| 完整成功 | HTTP 200 + write_file/present_files + 交付物或 ≥80 字分析文本 |
| 稳态 | C=32 × 1800s,到期后排空在途 |
| LangGraph | 4 shards × N_JOBS=8 ≈ 32 slots |
Source: …/2026-07-16-147-formal-c32-sustain30m-v3-mock32 · langgraph_resources.jsonl
P50 234.1 · P95 272.3 · P99 495.0 · 均 241.6
时序图横轴为开测后分钟数(降采样 ~30s,共 61 点);开头/结尾 active 偏低为爬坡与排空窗口。Sandbox 容器数长期低于 active_run,原因见下方说明。
X:开测后分钟 · Y:active_run_count
不含 watchdog · Docker 口径 100%≈1 核
合计峰 1.8 / 均 1.7 GiB
容器峰 4 / 均 2.28 · 内存峰 1.4 GiB
口径不同:active_run 含整段 run(含 Mock LLM 等待);container_count 是此刻存活的 sandbox Pod。
懒加载:仅 write_file 等工具 acquire;present_files 不强制占 Pod。
短占用窗口:并发 Pod ≈ 32 × (10–30s / 234s) ≈ 1.4–4,与峰 4 / 均 2.28 一致。
容量与回收:effective_replicas=12;reconcile 回收空闲 Pod。Gateway logical active 常为 0,orphan 易偏高,不代表泄漏。
| 资源 | 峰值 | 均值 | 解读 |
|---|---|---|---|
| LG CPU 合计 | 252% | 32% | 尖峰间歇,非持续算满 |
| LG 内存合计 | 1.8 GiB | 1.7 GiB | 远离 4Gi 上限 |
| Sandbox 容器 | 4 | 2.28 | 远低于 active_run≈32 |
| Sandbox 内存 | 1.4 GiB | 701 MiB | — |
容量:C=32 稳态 30 分钟可稳定运行(99.6%),4 分片负载均衡,active_run 长期维持 32,资源头room 充足。
延迟:成功路径集中 220–270s;1/251 为偶发 504→recovery timeout。
沙箱:峰 4 / 均 2.28 与懒加载短窗口一致,不能据此判沙箱为瓶颈。
边界:mock-perf infra 压测,不外推真实 Kimi 容量。
平台能力演进方向,非本次压测必修 checklist。
| 阶段 | 项 | 说明 | 落点 |
|---|---|---|---|
| 近 | 场景语义模板化 | 固定附 prompt / LLM 轮次 / Mock I/O / 判定 | loadtest report |
| 近 | 端到端延迟分解 | LLM / 沙箱 / 网关 / 超时恢复分段 | loadtest + obs |
| 中 | 沙箱与 active run 对齐可观测 | pod 数、acquire 峰、就绪耗时;reconcile 覆盖全分片 | provisioner + obs |
| 中 | Gateway 超时对齐 | 相对 medium P95 留足余量 | deploy |
| 中 | Mock 交付保真度分层 | 区分 infra / 交付格式 | mock_openai_llm |
| 远 | 真实模型容量曲线 | Kimi medium 单独 C 曲线 | benchmark |
| 远 | strict_deliverable 档 | 强制 artifact 稳态档 | loadtest flag |