Skip to content

[Bug] v2026.5.22 启动后 Gateway CPU 持续 100%+,导致请求延迟飙升 50-100 倍 #86512

Description

@mmhzlrj

版本信息

  • 升级前: v2026.5.12 (正常运行)
  • 升级后: v2026.5.22
  • 环境: macOS (Darwin), Node v22.22.0, MacBook Pro

问题描述

升级到 v2026.5.22 后,Gateway 进程持续占用 100%+ CPU(单核满载),导致所有 API 请求延迟飙升 50-100 倍。

实测数据

指标 v2026.5.12 v2026.5.22 恶化倍数
Gateway CPU ~5% 102% 20x
chat.history 延迟 ~100-200ms 11,131ms 55-110x
系统负载 ~2.0 7.09 3.5x
Gateway 内存 ~400MB 886MB 2.2x

根因分析

v2026.5.22 新增的 "provider auth-state pre-warming" 特性在启动时预热所有模型提供商,导致 Gateway 启动后持续数分钟占满单核 CPU。Release notes 描述此特性可在热路径上将 per-call 成本从 ~20s 降至 ~5ms(4100x 提升),但预热过程本身的 CPU 开销抵消了这一收益。

影响

  • 升级后用户感知到明显卡顿
  • chat.history 等基础 API 从亚秒级变为 10 秒+
  • 必须降级回 v2026.5.12 才能恢复正常

降级后

降级到 v2026.5.12 后,Gateway CPU 立即回落到 ~5%,所有延迟恢复正常。

建议

  1. 考虑将 provider warmup 改为异步后台任务(不阻塞 Gateway ready 信号)
  2. 或加入 warmup 进度/超时控制
  3. 或提供 opt-out 配置选项

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions