diff --git a/runtime-config-linux.md b/runtime-config-linux.md index 1cabc6156..432a4f3b2 100644 --- a/runtime-config-linux.md +++ b/runtime-config-linux.md @@ -128,7 +128,7 @@ Next parameters can be specified: ## Control groups Also known as cgroups, they are used to restrict resource usage for a container and handle -device access. cgroups provide controls to restrict cpu, memory, IO, and network for +device access. cgroups provide controls to restrict cpu, memory, IO, pids and network for the container. For more information, see the [kernel cgroups documentation](https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt). ## Sysctl diff --git a/runtime_config_linux.go b/runtime_config_linux.go index 24092237e..98ddb7db4 100644 --- a/runtime_config_linux.go +++ b/runtime_config_linux.go @@ -126,6 +126,11 @@ type CPU struct { Mems string `json:"mems"` } +type Pids struct { + // Maximum number of PIDs. A value < 0 implies "no limit". + Limit int64 `json:"limit"` +} + // Network identification and priority configuration type Network struct { // Set class identifier for container's network packets @@ -142,6 +147,8 @@ type Resources struct { Memory Memory `json:"memory"` // CPU resource restriction configuration CPU CPU `json:"cpu"` + // Task resource restriction configuration. + Pids Pids `json:"pids"` // BlockIO restriction configuration BlockIO BlockIO `json:"blockIO"` // Hugetlb limit (in bytes)