Skip to content

Add configurable docker container resource limits#359

Open
xingdi-eric-yuan wants to merge 1 commit intomainfrom
feature/configurable-container-resource-limits
Open

Add configurable docker container resource limits#359
xingdi-eric-yuan wants to merge 1 commit intomainfrom
feature/configurable-container-resource-limits

Conversation

@xingdi-eric-yuan
Copy link
Copy Markdown
Collaborator

Add mem_limit, pids_limit, and cpu_limit parameters to DockerTerminal so downstream users can control container resource constraints via YAML config.

  • mem_limit (default: "16G"): container memory limit, unchanged from previous hardcoded value
  • pids_limit (default: 4096): prevents fork bombs and runaway thread creation. Set to None for unlimited (Docker default)
  • cpu_limit (default: None/unlimited): max CPU cores, passed as nano_cpus

All parameters are backward compatible. New defaults preserve existing behavior except pids_limit which adds a safe default to prevent fork bomb incidents.

Configurable via YAML:
terminal:
type: docker
mem_limit: "32G"
pids_limit: 4096
cpu_limit: 4.0

…it, cpu_limit)

Add mem_limit, pids_limit, and cpu_limit parameters to DockerTerminal so
downstream users can control container resource constraints via YAML config.

- mem_limit (default: "16G"): container memory limit, unchanged from previous
  hardcoded value
- pids_limit (default: 4096): prevents fork bombs and runaway thread creation.
  Set to None for unlimited (Docker default)
- cpu_limit (default: None/unlimited): max CPU cores, passed as nano_cpus

All parameters are backward compatible. New defaults preserve existing behavior
except pids_limit which adds a safe default to prevent fork bomb incidents.

Configurable via YAML:
  terminal:
    type: docker
    mem_limit: "32G"
    pids_limit: 4096
    cpu_limit: 4.0

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant