🤖 perf: pool members read GET /api/v2/users/me on every workspace read, doubling the request budget
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 65/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- go, kubernetes
调研方向
Start in internal/controller/coderworkspacepoolmember_ready.go at readPoolMemberWorkspace and confirmPoolMemberCreate to see the per-member GET /api/v2/users/me call. Cache the operator user ID keyed by the token Secret's resourceVersion, preserving provenance checks, then update the measured table in docs/how-to/workspace-pools.md. Done means member reads no longer call /api/v2/users/me and request counts match the plan budget.
由索引模型根据 Issue 内容生成。
描述
Problem
Measured in Kind with Coder v2.37.2 while working on #441 (#153 plan PR 12): a pool of 10 ready members makes 26 Coder requests per minute. Plan section 9 budgets at most 13.
Each member read sends two requests: GET /api/v2/workspaces/<id> and GET /api/v2/users/me (readPoolMemberWorkspace and confirmPoolMemberCreate in internal/controller/coderworkspacepoolmember_ready.go). So a ready member makes 2 requests per minute and a member that builds makes 24 instead of 12. The pool adds 6 per minute.
/api/v2/users/me is one path for every member of the operator, and Coder rate-limits per user and per path (512 per minute by default, coderd/httpmw/ratelimit.go keyByNormalizedEndpoint). From the measured rates, about 500 ready members or about 40 members that build reach that limit (inferred, not tested at that size).
Proposal
Read the operator user once per operator token (for example, cache the ID keyed by the token Secret's resourceVersion) instead of once per member read, and keep the provenance checks that use it. Then update the measured table in docs/how-to/workspace-pools.md.
Trigger
Before pools are recommended for more than a few dozen members, or together with #153 plan PR 13.
Refs #153
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: xhigh
- 主要语言
- Go
- 星标
- 5
- 派生
- 3
- 平均合并
- 1 小时 50 分钟
- 30 天内合并 PR
- 160
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
coder/coder-k8s 的其他 Issue
-
难度 3/5 半天 新手友好度 62/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
-
难度 3/5 半天 新手友好度 45/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 30/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 8/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
open-feature/flagd-schemas#237 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
superplanehq/superplane#9234 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
betterleaks/betterleaks#469 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
prime-radiant-inc/evener#5901 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复