From 26bd356078a02313649c7562369a2b2de6b63e19 Mon Sep 17 00:00:00 2001 From: Victor Costan Date: Mon, 12 Oct 2015 11:17:49 -0400 Subject: [PATCH] Document CFS CPU period / quota support in the API. Docker 1.7 got support for specifying the CFS scheduler's CPU quota and period. The work appears to have started around commit dcc50e1d593fd7995189872791c6d7a013f16970. This change updates the API documentation to reflect the existing support. Signed-off-by: Victor Costan --- docs/reference/api/docker_remote_api.md | 2 ++ docs/reference/api/docker_remote_api_v1.19.md | 4 ++++ docs/reference/api/docker_remote_api_v1.20.md | 4 ++++ docs/reference/api/docker_remote_api_v1.21.md | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/docs/reference/api/docker_remote_api.md b/docs/reference/api/docker_remote_api.md index 36b125f9ac..cccd4e25a3 100644 --- a/docs/reference/api/docker_remote_api.md +++ b/docs/reference/api/docker_remote_api.md @@ -135,6 +135,8 @@ of a 404. `SwapLimit` are now returned as boolean instead of as an int. In addition, the end point now returns the new boolean fields `CpuCfsPeriod`, `CpuCfsQuota`, and `OomKillDisable`. +* The `hostConfig` option now accepts the fields `CpuPeriod` and `CpuQuota` +* `POST /build` accepts `cpuperiod` and `cpuquota` options ### v1.18 API changes diff --git a/docs/reference/api/docker_remote_api_v1.19.md b/docs/reference/api/docker_remote_api_v1.19.md index e96c8a34c5..efedb967ab 100644 --- a/docs/reference/api/docker_remote_api_v1.19.md +++ b/docs/reference/api/docker_remote_api_v1.19.md @@ -168,6 +168,7 @@ Create a container "MemorySwap": 0, "CpuShares": 512, "CpuPeriod": 100000, + "CpuQuota": 50000, "CpusetCpus": "0,1", "CpusetMems": "0,1", "BlkioWeight": 300, @@ -215,6 +216,7 @@ Json Parameters: - **CpuShares** - An integer value containing the container's CPU Shares (ie. the relative weight vs other containers). - **CpuPeriod** - The length of a CPU period in microseconds. +- **CpuQuota** - Microseconds of CPU time that the container can get in a CPU period. - **Cpuset** - Deprecated please don't use. Use `CpusetCpus` instead. - **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use. - **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. @@ -1218,6 +1220,8 @@ Query Parameters: - **memswap** - Total memory (memory + swap), `-1` to disable swap. - **cpushares** - CPU shares (relative weight). - **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`). +- **cpuperiod** - The length of a CPU period in microseconds. +- **cpuquota** - Microseconds of CPU time that the container can get in a CPU period. Request Headers: diff --git a/docs/reference/api/docker_remote_api_v1.20.md b/docs/reference/api/docker_remote_api_v1.20.md index cbd0809bd3..d5dabc7619 100644 --- a/docs/reference/api/docker_remote_api_v1.20.md +++ b/docs/reference/api/docker_remote_api_v1.20.md @@ -173,6 +173,7 @@ Create a container "MemorySwap": 0, "CpuShares": 512, "CpuPeriod": 100000, + "CpuQuota": 50000, "CpusetCpus": "0,1", "CpusetMems": "0,1", "BlkioWeight": 300, @@ -221,6 +222,7 @@ Json Parameters: - **CpuShares** - An integer value containing the container's CPU Shares (ie. the relative weight vs other containers). - **CpuPeriod** - The length of a CPU period in microseconds. +- **CpuQuota** - Microseconds of CPU time that the container can get in a CPU period. - **Cpuset** - Deprecated please don't use. Use `CpusetCpus` instead. - **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use. - **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. @@ -1341,6 +1343,8 @@ Query Parameters: - **memswap** - Total memory (memory + swap), `-1` to disable swap. - **cpushares** - CPU shares (relative weight). - **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`). +- **cpuperiod** - The length of a CPU period in microseconds. +- **cpuquota** - Microseconds of CPU time that the container can get in a CPU period. Request Headers: diff --git a/docs/reference/api/docker_remote_api_v1.21.md b/docs/reference/api/docker_remote_api_v1.21.md index a7b6884435..5115ee50e3 100644 --- a/docs/reference/api/docker_remote_api_v1.21.md +++ b/docs/reference/api/docker_remote_api_v1.21.md @@ -180,6 +180,7 @@ Create a container "KernelMemory": 0, "CpuShares": 512, "CpuPeriod": 100000, + "CpuQuota": 50000, "CpusetCpus": "0,1", "CpusetMems": "0,1", "BlkioWeight": 300, @@ -232,6 +233,7 @@ Json Parameters: - **CpuShares** - An integer value containing the container's CPU Shares (ie. the relative weight vs other containers). - **CpuPeriod** - The length of a CPU period in microseconds. +- **CpuQuota** - Microseconds of CPU time that the container can get in a CPU period. - **Cpuset** - Deprecated please don't use. Use `CpusetCpus` instead. - **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use. - **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. @@ -1378,6 +1380,8 @@ Query Parameters: - **memswap** - Total memory (memory + swap), `-1` to disable swap. - **cpushares** - CPU shares (relative weight). - **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`). +- **cpuperiod** - The length of a CPU period in microseconds. +- **cpuquota** - Microseconds of CPU time that the container can get in a CPU period. - **buildargs** – JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the `buildargs` as the environment context for command(s) run via the Dockerfile's `RUN` instruction or for