## Summary Renames the four validated architecture tiers by concurrent running workspaces (600, 1,200, 1,800, 6,000) and adds tiers for 10,000 and 20,000. User counts came from a fixed 0.6 workspaces-per-user ratio that doesn't hold once users run AI agents, so each tier now states only concurrent running workspaces and concurrent workspace builds, and the index page treats the tiers as starting points and explains how to estimate concurrent workspaces from users and agent adoption. Hardware numbers on the existing tiers don't change. All six tiers match `terraform/scenarios.tf` in `coder/scaletest`. ## Changes - Rename `1k-users`, `2k-users`, `3k-users`, and `10k-users` to `600-workspaces`, `1200-workspaces`, `1800-workspaces`, and `6000-workspaces`, and add `10000-workspaces` and `20000-workspaces`. - Each tier page states the three-region layout the scale tests use, the `CODER_PG_CONN_MAX_OPEN` and `CODER_PG_CONN_MAX_IDLE` values for `coderd`, and the Postgres `max_connections` value the tier ran with. - Size the database on the sizing index by the tier pages, not by users, and keep only instance families per cloud. - Replace the remaining per-user sizing in `scale-testing.md`, `scale-coder.md`, and `requirements.md`, and fix the provisioner build count (1, not 2) and idle agent memory (128 MB, not 256 MB). - Redirect the old pages, point the `architecture/*` redirects at the new pages, and add per-page rules ahead of the `admin/infrastructure/validated-architectures/*` wildcard so none of them chain. Refs DOCS-1453 ## Open questions for reviewers - **20k readiness**: ScaleGRU closed workspace traffic at 20k (GRU-75) on Nov 4, and workspace updates at 20k (GRU-76) is still open. Is the 20k tier ready to publish? - **Builds**: concurrent workspace builds equal the scenario's provisioner count. Did the 10k and 20k runs complete the create-workspaces phase cleanly at that concurrency? - **Version**: which Coder version, and NATS on or off, were the 10k and 20k runs on? - **20k database**: publish `max_connections` as 2,000 (tested) or about 2,200 (1,800 plus the 20% headroom in Connection pool tuning)? Did the run after the pool bump confirm that 64 vCPU holds, or does it need 96 vCPU? - **6k vs. 10k `max_connections`**: the scenarios set 1,200 on 6,000 and 1,000 on 10,000. The pages publish the tested values, so the larger tier shows the smaller number. - **600 tier proxies**: the 600 scenario runs 3 proxies at 2 vCPU and 8 GB in each secondary region, but the page has no Workspace Proxies section. Add one? - **Region layout**: `vars.tf` only accepts three regions, so the tier pages now say their numbers assume that layout. Confirm no single-region run exists. ## Testing - `make gen/docs-manifest` rebuilds `docs/manifest.json` with no diff, and `make lint/docs-manifest` passes. - `go run ./scripts/docsredirectscheck -base origin/main -branch main`: 352 rules OK, 839 routes still resolve. - `go run ./scripts/docshtmlcheck`, `scripts/check_emdash.sh`, and `pnpm run check-docs` pass. - Vale on the changed pages reports only advisory alerts on unchanged sentences. - Relative links and anchors on the changed pages resolve. <details> <summary>Review feedback addressed</summary> | Feedback | Resolution | |------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Drop per-user numbers (Spike, Callum, Nick) | Removed from intros, limits tables, and sidebar descriptions, plus the last per-user figure on the 600 page. | | Connection pool settings on 10k and 20k, and on 600 through 6,000 | Added to every tier from `scenarios.tf`, with the tested `max_connections`. | | Single region tested? | No, `vars.tf` requires three regions, so each tier page states the layout. | | "Safety margin" claim | Replaced with "run each tier at its full number of concurrent running workspaces". | | Typos carried over from the old pages | Fixed on all six pages. | | Merge conflicts and manifest | Rebased on `main` (most recently Dec 4), moved the sidebar entries into `docs/install/plan/sizing/sidebar.yml` after #32637, kept both sets of redirect rules, and rebuilt the manifest (no diff). | | Observability line | Split to one sentence per line on the two new pages. | | Two-hop redirects | The in-repo rules now point at the new pages; docs-engine and coder.com still carry their own copies, which is a follow-up outside this repo. | | Out-of-diff per-user sizing in `index.md` and `scale-testing.md` | Fixed in this PR rather than deferred, in separate commits so they can be split out on request. | | Node sizing too prescriptive, and no tier picks in the example (Spike) | **Node sizing** opens with the tiers as starting points and the "actual load" guidance, drops "choose the smallest architecture", and keeps only the developers-to-workspaces math in the example. It adds that a deployment can grow gradually with more `coderd` replicas or more CPU and memory, linked to Scale Coder. | </details> Follow-ups kept out of this PR: a dedicated NATS page, the stale methodology on the scale testing page, workload assumptions behind each tier, signals for moving up a tier, and the docs-engine and coder.com redirect copies. Original commits by @denisra, generated with [Claude Code](https://claude.com/claude-code). Rebase and review fixes by @nickvigilante. 🤖 Description updated with Coder Agents on behalf of @nickvigilante. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Nick Vigilante <nick.vigilante@coder.com>
10 KiB
title
| title |
|---|
| Scale Testing |
Scaling Coder involves planning and testing to make sure it can handle more load without compromising service. This process encompasses infrastructure setup, traffic projections, and aggressive testing to identify and mitigate potential bottlenecks.
A dedicated Kubernetes cluster for Coder is recommended to configure, host, and manage Coder workloads. Kubernetes provides container orchestration capabilities, allowing Coder to efficiently deploy, scale, and manage workspaces across a distributed infrastructure. This guarantees high availability, fault tolerance, and scalability for Coder deployments. Coder is deployed on this cluster using the Helm chart.
For more information about scaling, see our Coder scaling best practices.
Methodology
Our scale tests include the following stages:
-
Prepare environment: create expected users and provision workspaces.
-
SSH connections: establish user connections with agents, verifying their ability to echo back received content.
-
Web Terminal: verify the pseudo-terminal (PTY) connection used for communication with Web Terminal.
-
Workspace application traffic: confirm that specific workspace apps handle user connections and echo back received content.
-
Dashboard evaluation: verify the responsiveness and stability of Coder dashboards under varying load conditions.
This is achieved by simulating user interactions using instances of headless Chromium browsers.
-
Cleanup: delete workspaces and users created in step 1.
Infrastructure and setup requirements
The scale tests runner can distribute the workload to overlap single scenarios based on the workflow configuration:
| Scenario | T0 | T1 | T2 | T3 | T4 | T5 | T6 |
|---|---|---|---|---|---|---|---|
| SSH connections | X | X | X | X | |||
| Web Terminal (PTY) | X | X | X | X | |||
| Workspace apps | X | X | X | X | |||
| Dashboard (headless) | X | X | X | X |
This pattern closely reflects how our customers naturally use the system. SSH connections are heavily utilized because they're the primary communication channel for IDEs with VS Code and JetBrains plugins.
The basic setup of scale tests environment involves:
- Scale tests runner (32 vCPU, 128 GB RAM)
- Coder: 2 replicas (4 vCPU, 16 GB RAM)
- Database: 1 instance (2 vCPU, 32 GB RAM)
- Provisioner: 50 instances (0.5 vCPU, 512 MB RAM)
The test is deemed successful if:
- Users did not experience interruptions in their workflows,
coderddid not crash or require restarts, and- No other internal errors were observed.
Traffic Projections
In our scale tests, we simulate activity from 2000 users, 2000 workspaces, and 2000 agents, with two items of workspace agent metadata being sent every 10 seconds. Here are the resulting metrics:
Coder:
- Median CPU usage for
coderd: 3 vCPU, peaking at 3.7 vCPU while all tests are running concurrently. - Median API request rate: 350 requests per second (RPS) during dashboard tests, 250 RPS during Web Terminal and workspace apps tests.
- 2000 agent API connections with latency: p90 at 60 ms, p95 at 220 ms.
- on average 2400 Web Socket connections during dashboard tests.
Provisionerd:
- Median CPU usage is 0.35 vCPU during workspace provisioning.
Database:
- Median CPU utilization is 80%, with a significant portion dedicated to writing workspace agent metadata.
- Memory utilization averages at 40%.
write_ops_countbetween 6.7 and 8.4 operations per second.
Available reference architectures
- Up to 600 concurrent workspaces
- Up to 1,200 concurrent workspaces
- Up to 1,800 concurrent workspaces
- Up to 6,000 concurrent workspaces
- Up to 10,000 concurrent workspaces
- Up to 20,000 concurrent workspaces
Hardware recommendation
Control plane: coderd
To maintain stability and reliability of the Coder control plane, it's essential to focus on node sizing, resource limits, and the number of replicas. We recommend referencing public cloud providers such as AWS, GCP, and Azure for guidance on optimal configurations. A reasonable approach involves using scaling formulas based on factors like CPU, memory, and the number of concurrent running workspaces.
While the minimum requirements specify 1 CPU core and 2 GB of memory per coderd replica, we recommend that you allocate additional resources depending on the workload size to maintain deployment stability.
CPU and memory usage
Enabling agent stats collection (optional) might increase memory consumption.
Enabling direct connections between users and workspace agents (apps or SSH traffic) can help prevent an increase in CPU usage. It is recommended to keep this option enabled unless there are compelling reasons to disable it.
Inactive users do not consume Coder resources.
Scaling formula
When determining scaling requirements, consider the following factors:
- Concurrent running workspaces: Start from the
coderdvCPU, memory, and replica count in the reference architecture that matches your number of concurrent running workspaces. - API latency/response time: Monitor API latency and response times to make sure performance stays optimal under varying loads.
- Average number of HTTP requests: Track the average number of HTTP requests to gauge system usage and identify potential bottlenecks. The number of proxied connections: For a very high number of proxied connections, more memory is required.
HTTP API latency
For a reliable Coder deployment dealing with medium to high loads, it's important that API calls for workspace/template queries and workspace build operations respond within 300 ms. However, API template insights calls, which involve browsing workspace agent stats and user activity data, might require more time. Moreover, Coder API exposes WebSocket long-lived connections for Web Terminal (bidirectional), and Workspace events/logs (unidirectional).
If the Coder deployment expects traffic from developers spread across the globe, be aware that customer-facing latency might be higher because of the distance between users and the load balancer. Fortunately, the latency can be improved with a deployment of Coder workspace proxies.
Node Autoscaling
We recommend disabling the autoscaling for coderd nodes.
Autoscaling can cause interruptions for user connections, see Autoscaling for more details.
Control plane: Workspace Proxies
When scaling workspace proxies, follow the same guidelines as for coderd above:
- Match the workspace proxy vCPU, memory, and replica count in the reference architecture for your number of concurrent running workspaces.
- Disable autoscaling.
Control plane: provisionerd
Each external provisioner can run a single concurrent workspace build. For example, running 10 provisioner containers will allow 10 users to start workspaces at the same time.
By default, the control plane runs 3 built-in provisioner daemons, but the Premium Coder release allows for running external provisioners to separate the load caused by workspace provisioning on the coderd nodes.
Scaling formula
When determining scaling requirements, consider the following factors:
1 vCPU x 1 GB memory x 1 concurrent workspace build: A formula to determine resource allocation based on the number of concurrent workspace builds, and standard complexity of a Terraform template. Rule of thumb: the more provisioners are free/available, the more concurrent workspace builds can be performed.
Node Autoscaling
Autoscaling provisioners is not an easy problem to solve unless it can be predicted when a number of concurrent workspace builds increases.
We recommend disabling autoscaling and adjusting the number of provisioners to developer needs based on the workspace build queuing time.
Data plane: Workspaces
To determine workspace resource limits and keep the best developer experience for workspace users, administrators must be aware of a few assumptions.
- Workspace pods run on the same Kubernetes cluster, but possibly in a different namespace or on a separate set of nodes.
- Workspace limits (per workspace user):
- Evaluate the workspace utilization pattern. For instance, web application development does not require high CPU capacity at all times, but will spike during builds or testing.
- Evaluate minimal limits for single workspace. Include in the calculation requirements for Coder agent running in an idle workspace - 0.1 vCPU and 128 MB. For instance, developers can choose between 0.5-8 vCPUs, and 1-16 GB memory.
Scaling formula
When determining scaling requirements, consider the following factors:
1 vCPU x 2 GB memory x 1 workspace: A formula to determine resource allocation based on the minimal requirements for an idle workspace with a running Coder agent and occasional CPU and memory bursts for building projects.
Node Autoscaling
Workspace nodes can be set to operate in autoscaling mode to mitigate the risk of prolonged high resource utilization.
One approach is to scale up workspace nodes when total CPU usage or memory consumption reaches 80%. Another option is to scale based on metrics such as the number of workspaces or active users. It's important to note that as new users onboard, the autoscaling configuration should account for ongoing workspaces.
Scaling down workspace nodes to zero is not recommended, as it will result in longer wait times for workspace provisioning by users. However, this might be necessary for workspaces with special resource requirements (for example, graphics processing units (GPUs)) that incur significant cost overheads.