🤖 perf: pool members read GET /api/v2/users/me on every workspace read, doubling the request budget

オープン
#443 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
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分
マージ済み PR(30日)
160

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

coder/coder-k8s のほかの issue

coder/coder-k8s の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。