External Services

Update a service's resource limits (memory, CPU caps).

Persists the new caps to the encrypted config AND live-applies them via Docker's update API. Memory and CPU can be hot-changed without a restart on running containers; stopped containers also accept the update and pick up the new caps on next start.

Pass null (or omit) any field to leave it unlimited. A request where every field is null removes any existing limits.

The response includes a per-container applied[] list so the caller can tell which members got the update and which were skipped (e.g., container not yet created, or docker update rejected because the new memory cap is below current usage).

patch/external-services/{id}/resources

Request

  • Base URL: /api (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /api/external-services/{id}/resources
  • Auth: none declared

Path parameters

idinteger required

External service ID

Request body

cpu_sharesinteger nullable

Relative CPU weight (default 1024). Only used when nano_cpus is None.

memory_mbinteger nullable

Hard memory limit in MiB. None = unlimited.

memory_swap_mbinteger nullable

Memory + swap limit in MiB. None = unlimited. MUST be >= memory_mb when both are set; Docker rejects the request otherwise. Set equal to memory_mb to disable swap entirely.

nano_cpusinteger nullable

CPU quota in nano-cpus. 1_000_000_000 = 1 full CPU core. None = unlimited.

shm_size_mbinteger nullable

Shared memory (/dev/shm) size in MiB. None = Docker default (64 MiB). Maps to HostConfig.shm_size (bytes). PostgreSQL uses /dev/shm for parallel query workers and large work_mem; the 64 MiB default causes "could not resize shared memory segment ... No space left on device" under load. NOTE: shm_size is fixed at container-create time — Docker's live update API cannot change it, so changing this value recreates the container.

Response

Updated resource limits

Changes

No recorded changes to this operation across all 50 revisions of this API.