Skip to content

Cost containment: default concurrency limit on API-provisioned workspaces + 10-minute worker spindown - #1843

Open
luke-lombardi wants to merge 3 commits into
mainfrom
ll/provision-default-limit
Open

Cost containment: default concurrency limit on API-provisioned workspaces + 10-minute worker spindown#1843
luke-lombardi wants to merge 3 commits into
mainfrom
ll/provision-default-limit

Conversation

@luke-lombardi

@luke-lombardi luke-lombardi commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Two remaining cost-containment changes not yet in main (follow-ups to #1841):

  • Default concurrency limit for API-provisioned workspaces (pkg/api/v1/workspace.go): workspaces created directly via POST /api/v1/workspace (e.g. by tama) now get the platform default concurrency limit at creation, so they can never start out unlimited. Control planes that manage per-tier quotas overwrite the row afterwards. No-op unless gateway.defaultConcurrencyLimit is configured.

  • Worker spindown 5 → 10 minutes (pkg/worker/worker.go): prod demand includes 5-minute cron jobs; a 300s spindown killed idle workers moments before the next tick re-provisioned identical capacity, churning nodes, image pulls, and cross-AZ traffic every cycle. 10 minutes lets recurring jobs reuse warm workers. Takes effect on the next worker image release.

Test plan

  • go build ./pkg/worker/ ./pkg/api/...
  • Existing scheduler/API tests pass
  • After worker image release: confirm workers survive across 5-minute cron ticks and node churn drops

luke-lombardi and others added 2 commits August 13, 2026 13:19
POST /api/v1/workspace is called directly by control planes (tama) with a
cluster-admin token, bypassing any signup flow that would assign a quota.
Those workspaces had no concurrency_limit row and therefore unlimited
concurrent capacity. Create the platform default
(gateway.defaultConcurrencyLimit) in the same request so no workspace can
be born unlimited; tier-aware control planes overwrite the row afterwards.

Co-authored-by: Cursor <cursoragent@cursor.com>
Prod demand includes 5-minute cron jobs; a 300s spindown killed workers
moments before the next tick re-provisioned identical capacity, churning
nodes, image pulls, and cross-AZ traffic on every cycle.

Co-authored-by: Cursor <cursoragent@cursor.com>
@luke-lombardi luke-lombardi changed the title Create default concurrency limit when provisioning workspaces via API Cost containment: default concurrency limit on API-provisioned workspaces + 10-minute worker spindown Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant