Skip to content

docs: add guidance for high-concurrency prebuilt workspace claims - #31944

Closed
coder[bot] wants to merge 1 commit into
mainfrom
docs/prebuilds-high-concurrency-claims
Closed

coder[bot] wants to merge 1 commit into
mainfrom
docs/prebuilds-high-concurrency-claims

Conversation

@coder

@coder coder Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Adds a Prepare for high-concurrency claims section to the prebuilt workspaces page. It covers what admins should do when many developers create workspaces from the same preset at once, such as a training session or onboarding day:

  • Before the event: size the pool with headroom, give it time to fill, confirm eligible matches desired, and raise CODER_PG_CONN_MAX_OPEN.
  • During the event: don't publish template versions, invalidate presets, or lower instances; retry 409 Conflict from API clients with jitter; watch the claim metrics.

Also adds a short note to Template updates and the prebuilt workspace lifecycle: until the new version's prebuilds are eligible, new workspaces are built from scratch.

Verified against code

  • Pool exhaustion falls back to a normal build (coderd/workspaces.go, ErrNoClaimablePrebuiltWorkspaces).
  • 409 comes from wsbuilder (http.StatusConflict, "A workspace build is already active.").
  • CODER_PG_CONN_MAX_OPEN default is 10 (server CLI reference).
  • Prebuild metrics carry template_name, preset_name, and organization_name labels (enterprise/coderd/prebuilds/metricscollector.go).

Needs engineering confirmation before merge

  • The 20 to 30 percent headroom recommendation
  • Retry delay of 1 to 2 seconds with jitter
  • Whether to publish a recommended CODER_PG_CONN_MAX_OPEN range (field guidance was about 50 to 100 per replica; left out of the page until confirmed)
  • The line that a claim in progress can fail if its prebuild is deleted (known limitation noted in fix(coderd/database): lock the workspaces row when claiming a prebuild #31518; included as configure-around guidance per the content guidelines' bug exception)

Intentionally left out

Linear: DOCS-1729

@coder
coder Bot temporarily deployed to main November 9, 2026 23:37 Inactive
@coder
coder Bot temporarily deployed to main November 9, 2026 23:37 Inactive
@github-actions github-actions Bot added the community Pull Requests and issues created by the community. label Nov 9, 2026
@coder
coder Bot requested a review from nickvigilante November 9, 2026 23:37
@linear-code

linear-code Bot commented Nov 9, 2026

Copy link
Copy Markdown

DOCS-1729

- Coder will automatically create new prebuilt workspaces with the updated dependencies.

The system always maintains the desired number of prebuilt workspaces for the active template version.
Until the new prebuilt workspaces are eligible, workspaces created from the new version's presets are built from scratch.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use something less idiomatic than "from scratch" here?


During the event:

- Don't publish a new template version, invalidate presets, or lower `instances`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Don't publish a new template version, invalidate presets, or lower `instances`.
- Do not publish a new template version, invalidate presets, or lower `instances`.

Each of these actions deletes unclaimed prebuilt workspaces, so developers get full builds until the replacements are eligible.
A claim that is in progress when its prebuilt workspace is deleted can also fail.

- If you create workspaces through the [API](../../reference/api/workspaces.md#create-user-workspace) or other automation, retry requests that return `409 Conflict` after a short, randomized delay of 1 to 2 seconds.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- If you create workspaces through the [API](../../reference/api/workspaces.md#create-user-workspace) or other automation, retry requests that return `409 Conflict` after a short, randomized delay of 1 to 2 seconds.
- If you create workspaces through the [API](../../reference/api/workspaces.md#create-user-workspace) or other automation, retry requests that return `409 Conflict` after a short, randomized delay of a few (1 to 2) seconds.

@nickvigilante

Copy link
Copy Markdown
Collaborator

Closing and reopening under a human author, as required for this repository.

@nickvigilante
nickvigilante temporarily deployed to main November 10, 2026 15:55 — with GitHub Actions Inactive
@nickvigilante
nickvigilante temporarily deployed to main November 10, 2026 15:55 — with GitHub Actions Inactive
@nickvigilante
nickvigilante temporarily deployed to main November 10, 2026 15:55 — with GitHub Actions Inactive
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 10, 2026
@nickvigilante
nickvigilante temporarily deployed to main November 10, 2026 15:55 — with GitHub Actions Inactive
@nickvigilante
nickvigilante temporarily deployed to main November 10, 2026 23:05 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
main — 3a6c672e Deployed Nov 10, 2026 by nickvigilante via cla #253753
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community Pull Requests and issues created by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant