Resource limits
Optional CPU and memory limits for Project containers, configured per Project (Project group), repository and session. Nothing is limited by default. Limits are set in Settings → Resource limits (terminal and browser) or through the Core API, and are applied to the containers that run the work.
Inheritance
Each field (CPU, memory) is resolved independently from the most specific level that sets a value:
- Session — only while it is the only active session in its container;
- Repository — the repository's container limit (
Project.limits); - Project — the Project group, inherited by all of its repositories.
Example: Project acme sets 8 CPU and 16 GiB, repository api sets 6 GiB, and
a session alone in its own container sets 2 CPU. That container runs with
2 CPU (session) and 6 GiB (repository).
A field that no level sets is not limited. A value that a container editor set
directly on one container (Projects → container → limits, or
devctl project limits) is kept until a level sets that field; a value that
was applied from a level is removed again when every level is cleared.
Shared containers
Several sessions can share one container (the repository's main container, or a container shared by repositories of the same group). Docker limits a container, not a process inside it, so a shared container always uses the repository level (falling back to the Project level). Session values remain stored but are shown as not in effect while the container hosts more than one active (starting or running) session. When the container again hosts a single active session, that session's value applies live. The settings view, the Projects container row and every session row say when the repository limit applies because the container is shared.
A container shared by another repository of the group follows the limits of the repository that owns the container.
Where limits apply
- Project containers. The start command carries the effective limits and
the Host applies them to the newly created container before it is used.
Changing a limit while the container runs is a live
docker updateofNanoCpusandMemory; the container, its processes and its tmux sessions are not restarted. The process (pids) and swap settings are preserved. - DinD sidecars. The isolated Docker sidecar of a container is created with
the same
--cpus/--memoryvalues and follows live changes. Nested containers share the sidecar's cgroup, so the sidecar limit bounds the whole nested Docker tree. The sidecar keeps its own process ceiling. - Not applied to the devctrl control plane (Core, Host and web, which keep
their
cpu_sharespriority), to Compose-managed containers, to Control Room and its task container, or to compute-provider workspaces. The Host refuses any live update that would reach a Compose-managed container.
Server-user containers reserve their resource envelope at start. Their limit changes are recorded and applied at the container's next start; the settings view marks such containers.
Validation
- CPU: 0.01–256; memory: at least 64 MiB.
- A value above the CPU count or physical memory of a host that runs (or is preferred for) an affected container is refused; without such a container the value must fit the largest known host.
- Memory cannot be lowered below current usage. Core compares the new value with the container's last observed memory use and refuses the change before anything is stored. The Host checks again with Docker's current figure (the cgroup's current memory, the same value the console shows as used) for the container and its sidecar before the first update, so a refused decrease changes nothing. The message names the current usage to choose instead.
- A memory limit below the container's
/dev/shmsize is refused. - Changes carry the revision of the view they were made from; a concurrent change is refused with 409.
Current consumption
- Settings → Resource limits lists, for the selected Project, repository or session, each affected container with its effective CPU and memory, the level each value comes from, current CPU % and memory against the limit, the shared state and the capacity of the hosts.
- Projects shows a limit row for each limited or shared container, next to the existing CPU/RAM bars, which measure usage against the configured limit.
- Projects and Sessions show, for each session, its container's CPU % and memory against the limit, from the existing inventory telemetry.
API
| Route | Policy | Purpose |
|---|---|---|
GET /v1/resource-limits |
user (owner-filtered) | Settings per level, effective limits with source level, shared state, host capacity, usage |
PUT /v1/resource-limits/projects/:id |
operator | Project group limits |
PUT /v1/resource-limits/repositories/:id |
operator | Repository limits |
PUT /v1/resource-limits/sessions/:id |
operator | Session limits |
Body: {"limits":{"cpus":2,"memoryBytes":4294967296},"revision":3}. Omitted
fields inherit. The response returns the new view and one entry per affected
container: live (a Host command was queued), next-start or unchanged.
Changes are audited as resource-limits.<level>.changed.
Project-group and session values live in Core integration state
(resource-limits:v1); repository values are Project.limits, which also seeds
new containers and placement admission.
Limitations
- A Host that refuses a live update (for example after memory grew between the Core check and the update) reports the failure on the container; the new value stays recorded and is applied at the next start.
- Project-group limits do not change placement admission; admission uses the repository limit as before.
- A stored session value whose session record was removed stays in the settings record until it is cleared.