Browse code

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 <costan@gmail.com>

Victor Costan authored on 2015/10/13 00:17:49
Showing 4 changed files
... ...
@@ -135,6 +135,8 @@ of a 404.
135 135
 `SwapLimit` are now returned as boolean instead of as an int. In addition, the
136 136
 end point now returns the new boolean fields `CpuCfsPeriod`, `CpuCfsQuota`, and
137 137
 `OomKillDisable`.
138
+* The `hostConfig` option now accepts the fields `CpuPeriod` and `CpuQuota`
139
+* `POST /build` accepts `cpuperiod` and `cpuquota` options
138 140
 
139 141
 ### v1.18 API changes
140 142
 
... ...
@@ -168,6 +168,7 @@ Create a container
168 168
              "MemorySwap": 0,
169 169
              "CpuShares": 512,
170 170
              "CpuPeriod": 100000,
171
+             "CpuQuota": 50000,
171 172
              "CpusetCpus": "0,1",
172 173
              "CpusetMems": "0,1",
173 174
              "BlkioWeight": 300,
... ...
@@ -215,6 +216,7 @@ Json Parameters:
215 215
 -   **CpuShares** - An integer value containing the container's CPU Shares
216 216
       (ie. the relative weight vs other containers).
217 217
 -   **CpuPeriod** - The length of a CPU period in microseconds.
218
+-   **CpuQuota** - Microseconds of CPU time that the container can get in a CPU period.
218 219
 -   **Cpuset** - Deprecated please don't use. Use `CpusetCpus` instead. 
219 220
 -   **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use.
220 221
 -   **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
... ...
@@ -1218,6 +1220,8 @@ Query Parameters:
1218 1218
 -   **memswap** - Total memory (memory + swap), `-1` to disable swap.
1219 1219
 -   **cpushares** - CPU shares (relative weight).
1220 1220
 -   **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`).
1221
+-   **cpuperiod** - The length of a CPU period in microseconds.
1222
+-   **cpuquota** - Microseconds of CPU time that the container can get in a CPU period.
1221 1223
 
1222 1224
     Request Headers:
1223 1225
 
... ...
@@ -173,6 +173,7 @@ Create a container
173 173
              "MemorySwap": 0,
174 174
              "CpuShares": 512,
175 175
              "CpuPeriod": 100000,
176
+             "CpuQuota": 50000,
176 177
              "CpusetCpus": "0,1",
177 178
              "CpusetMems": "0,1",
178 179
              "BlkioWeight": 300,
... ...
@@ -221,6 +222,7 @@ Json Parameters:
221 221
 -   **CpuShares** - An integer value containing the container's CPU Shares
222 222
       (ie. the relative weight vs other containers).
223 223
 -   **CpuPeriod** - The length of a CPU period in microseconds.
224
+-   **CpuQuota** - Microseconds of CPU time that the container can get in a CPU period.
224 225
 -   **Cpuset** - Deprecated please don't use. Use `CpusetCpus` instead. 
225 226
 -   **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use.
226 227
 -   **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
... ...
@@ -1341,6 +1343,8 @@ Query Parameters:
1341 1341
 -   **memswap** - Total memory (memory + swap), `-1` to disable swap.
1342 1342
 -   **cpushares** - CPU shares (relative weight).
1343 1343
 -   **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`).
1344
+-   **cpuperiod** - The length of a CPU period in microseconds.
1345
+-   **cpuquota** - Microseconds of CPU time that the container can get in a CPU period.
1344 1346
 
1345 1347
     Request Headers:
1346 1348
 
... ...
@@ -180,6 +180,7 @@ Create a container
180 180
              "KernelMemory": 0,
181 181
              "CpuShares": 512,
182 182
              "CpuPeriod": 100000,
183
+             "CpuQuota": 50000,
183 184
              "CpusetCpus": "0,1",
184 185
              "CpusetMems": "0,1",
185 186
              "BlkioWeight": 300,
... ...
@@ -232,6 +233,7 @@ Json Parameters:
232 232
 -   **CpuShares** - An integer value containing the container's CPU Shares
233 233
       (ie. the relative weight vs other containers).
234 234
 -   **CpuPeriod** - The length of a CPU period in microseconds.
235
+-   **CpuQuota** - Microseconds of CPU time that the container can get in a CPU period.
235 236
 -   **Cpuset** - Deprecated please don't use. Use `CpusetCpus` instead.
236 237
 -   **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use.
237 238
 -   **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
... ...
@@ -1378,6 +1380,8 @@ Query Parameters:
1378 1378
 -   **memswap** - Total memory (memory + swap), `-1` to disable swap.
1379 1379
 -   **cpushares** - CPU shares (relative weight).
1380 1380
 -   **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`).
1381
+-   **cpuperiod** - The length of a CPU period in microseconds.
1382
+-   **cpuquota** - Microseconds of CPU time that the container can get in a CPU period.
1381 1383
 -   **buildargs** – JSON map of string pairs for build-time variables. Users pass
1382 1384
         these values at build-time. Docker uses the `buildargs` as the environment
1383 1385
         context for command(s) run via the Dockerfile's `RUN` instruction or for