Cost containment: default concurrency limit on API-provisioned workspaces + 10-minute worker spindown - #1843
Open
luke-lombardi wants to merge 3 commits into
Open
Cost containment: default concurrency limit on API-provisioned workspaces + 10-minute worker spindown#1843luke-lombardi wants to merge 3 commits into
luke-lombardi wants to merge 3 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 viaPOST /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 unlessgateway.defaultConcurrencyLimitis 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/...