Skip to main content

Module limits

Module limits 

Source
Expand description

CPU, memory and process limits of a container agent’s container. docs/specs/SPEC_CONTAINER_AGENT_RESOURCE_LIMITS_2026_10_29.md.

Every container agent is limited, existing ones too. What it gets is the agent’s own setting, else the app-wide one, else a default computed from what the Docker daemon has (docker info: on Docker Desktop that is the VM, not the machine). The limits are put on a running container with docker update: a change never recreates it.

Structs§

ContainerLimits
An agent’s own limits (db_agent_container_limits). Limit::Auto means “the app-wide setting decides”.
DaemonCapacity
What the daemon has to give.
Wanted
The limits a container should carry.

Enums§

Limit
One limit as a person set it.
Target
What to do about one limit of a container.

Constants§

RECOMMENDED_MIN_MEMORY_LABEL
An image label saying how much memory a container from it needs to be useful, in MB: a developer image that builds Rust says so, and auto never gives it less (still bounded by what the daemon has).
SETTING_CPUS
App-wide default CPU limit, in CPUs, or "auto".
SETTING_MEMORY
App-wide default memory limit, in MB, or "auto".

Functions§

auto_cpu_millis
The default CPUs, in thousandths: all but a quarter of the cores, at least one.
auto_memory_bytes
The default memory: half of the daemon’s, never under 2 GiB (capped at what the daemon has). The spec’s ceiling of “total minus 2 GiB” is never under half from 4 GiB up, and under 4 GiB the floor rules, so it needs no code. An image’s recommended minimum raises the default, still bounded by the daemon’s total.
install_config
Attach the live settings (bootstrap), so the app-wide limits can be read.
normalize
A limit as stored: "" for auto, "0" for no limit, else the number (MB, or CPUs). An explicit value that is none of these is an error, where Limit::from_json is lenient with what it reads back.