-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Coder gives developers the ability to self-serve compute. Today, major v1 deployments spend up to 5 times their license costs on workspace resources.
Administrators manage their cloud resource costs asynchronously. They periodically track down expensive users and interrupt their work.
A built-in, synchronous quota system gives developers and administrators peace of mind by enforcing limits during workspace creation.
Example implementation
➕ Community – Counts
In the basic version, we have per-user limits. Basically, a user may have up to N workspaces for a project with a per_user
quota of N.
resource "coder_quota" "main" {
per_user = 3
}
Implementation note → This approach requires no organizational configs, UIs or APIs. An engineer should be able to implement it in less than two days.
⏩ Why Prioritize?
Without any quota, it’s possible for developers to DoS (even accidentally) Coder by creating too many workspaces. We want Coder to spread virally after installation, but if administrators can't define an upper bound to cost, it seems unlikely they would open the floodgates.
💲 Enterprise – Costs
In the cloud (in practice) there is an unlimited supply of each resource, and (in practice) costs scale linearly with a no. resources demanded. A minuscule portion of our customers are on-prem, and they are unlikely ever to exceed 5% of our revenue. We should design the quota system around the cloud model.
With the enterprise plan, an admin can give each template a cost which is a positive integer. Afterward, each organization can assign cost quotas to teams, and then teams can subdivide the quota amongst members. The currency is irrelevant to Coder, although I assume that most would use their national currency.
resource "coder_quota" "main" {
// At least one of these must be provided
cost = 10
per_user = 3
}
cost
**is more scalable than per_user
. If an organization has 20 projects and each of those projects have a per_user
of 2, then each developer can create 40 workspaces. That would probably not be OK. When using cost
, workspaces are now commensurable so enterprises don't have to decide between user choice and cost control.
❌ Per-project limits
Coder users should never get blocked by a human to provision a workspace.
Per-project limits can lead to human blocks and should be avoided. For example, let’s say an org limited gcp-linux-vm
to 10 max across the entire org. The count could stay under 10 for many weeks, and then, surprisingly, on week 5, a developer can’t create a VM. An admin must step in and up the limit or remove a workspace. Another problematic situation is a developer recreating their workspace when the limit is reached and then cannot work until admin intervention.
Open questions
- Should we have the ability to separate the costs for offline and online resources? E.g feat: Auto delete workspaces that are in stopped state for a speceified time #3388?
- Should we implement template <> quota definition as code or a UI option?