You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`WeightDevice`, `ThrottleReadBpsDevice`, `ThrottleWriteBpsDevice`,
`ThrottleReadIOpsDevice`, `ThrottleWriteIOpsDevice` are now slices to
well defined structs to allow setting multiple devices in their respective
blkio file. By using a string to represents those values it wasn't possible
to set correct values when multiple devices were passed in the config
(either newline separated or comma separated).
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Devices is an array specifying the list of devices to be created in the container.
51
51
Next parameters can be specified:
52
52
53
-
* type - type of device: 'c', 'b', 'u' or 'p'. More info in `man mknod`
54
-
* path - full path to device inside container
55
-
* major, minor - major, minor numbers for device. More info in `man mknod`.
53
+
***type** - type of device: `c`, `b`, `u` or `p`. More info in `man mknod`
54
+
***path** - full path to device inside container
55
+
***major, minor** - major, minor numbers for device. More info in `man mknod`.
56
56
There is special value: `-1`, which means `*` for `device`
57
57
cgroup setup.
58
-
* permissions - cgroup permissions for device. A composition of 'r'
59
-
(read), 'w' (write), and 'm' (mknod).
60
-
* fileMode - file mode for device file
61
-
* uid - uid of device owner
62
-
* gid - gid of device owner
58
+
***permissions** - cgroup permissions for device. A composition of `r`
59
+
(read), `w` (write), and `m` (mknod).
60
+
***fileMode** - file mode for device file
61
+
***uid** - uid of device owner
62
+
***gid** - gid of device owner
63
63
64
64
```json
65
65
"devices": [
@@ -146,45 +146,130 @@ The cgroups will be created if they don't exist.
146
146
147
147
`cgroupsPath` can be used to either control the cgroups hierarchy for containers or to run a new process in an existing container.
148
148
149
-
Optionally, cgroups limits can be specified via `resources`.
149
+
You can configure a container's cgroups via the `resources` field of the Linux configuration.
150
+
Do not specify `resources` unless limits have to be updated.
151
+
For example, to run a new process in an existing container without updating limits, `resources` need not be specified.
152
+
153
+
#### Disable out-of-memory killer
150
154
151
155
```json
152
-
"resources": {
153
-
"disableOOMKiller": false,
154
-
"memory": {
155
-
"limit": 0,
156
-
"reservation": 0,
157
-
"swap": 0,
158
-
"kernel": 0,
159
-
"swappiness": -1
160
-
},
161
-
"cpu": {
162
-
"shares": 0,
163
-
"quota": 0,
164
-
"period": 0,
165
-
"realtimeRuntime": 0,
166
-
"realtimePeriod": 0,
167
-
"cpus": "",
168
-
"mems": ""
169
-
},
170
-
"blockIO": {
171
-
"blkioWeight": 0,
172
-
"blkioWeightDevice": "",
173
-
"blkioThrottleReadBpsDevice": "",
174
-
"blkioThrottleWriteBpsDevice": "",
175
-
"blkioThrottleReadIopsDevice": "",
176
-
"blkioThrottleWriteIopsDevice": ""
177
-
},
178
-
"hugepageLimits": null,
179
-
"network": {
180
-
"classId": "",
181
-
"priorities": null
182
-
}
183
-
}
156
+
"disableOOMKiller": false
184
157
```
185
158
186
-
Do not specify `resources` unless limits have to be updated.
187
-
For example, to run a new process in an existing container without updating limits, `resources` need not be specified.
159
+
#### Memory
160
+
161
+
```json
162
+
"memory": {
163
+
"limit": 0,
164
+
"reservation": 0,
165
+
"swap": 0,
166
+
"kernel": 0,
167
+
"swappiness": -1
168
+
}
169
+
```
170
+
171
+
#### CPU
172
+
173
+
```json
174
+
"cpu": {
175
+
"shares": 0,
176
+
"quota": 0,
177
+
"period": 0,
178
+
"realtimeRuntime": 0,
179
+
"realtimePeriod": 0,
180
+
"cpus": "",
181
+
"mems": ""
182
+
}
183
+
```
184
+
185
+
#### Block IO Controller
186
+
187
+
`blockIO` represents the cgroup subsystem `blkio` which implements the block io controller.
188
+
For more information, see the [kernel cgroups documentation about `blkio`](https://www.kernel.org/doc/Documentation/cgroups/blkio-controller.txt).
189
+
190
+
```json
191
+
"blockIO": {
192
+
"blkioWeight": 0,
193
+
"blkioLeafWeight": 0,
194
+
"blkioWeightDevice": [
195
+
{
196
+
"major": 8,
197
+
"minor": 0,
198
+
"weight": 500,
199
+
"leafWeight": 300
200
+
},
201
+
{
202
+
"major": 8,
203
+
"minor": 16,
204
+
"weight": 500
205
+
}
206
+
],
207
+
"blkioThrottleReadBpsDevice": [
208
+
{
209
+
"major": 8,
210
+
"minor": 0,
211
+
"rate": 600
212
+
}
213
+
],
214
+
"blkioThrottleWriteBpsDevice": null,
215
+
"blkioThrottleReadIOPSDevice": null,
216
+
"blkioThrottleWriteIOPSDevice": [
217
+
{
218
+
"major": 8,
219
+
"minor": 16,
220
+
"rate": 300
221
+
}
222
+
]
223
+
}
224
+
```
225
+
226
+
`blkioWeight` (uint16, optional) - specifies per cgroup weight, this is default weight of the group on all the devices until and unless overridden by per device rule, range is from 10 to 1000
227
+
228
+
`blkioLeafWeight` (uint16, optional) - equivalents of `blkioWeight` for the purpose of deciding how much weight tasks in the given cgroup has while competing with the cgroup's child cgroups, range is from 10 to 1000
229
+
230
+
`blkioWeightDevice` (array, optional) - specifies the list of devices on which bandwidth rate limit will be applied. Next parameters can be specified per device:
231
+
232
+
***major** (int64, required) - major number of the device that will be limited
233
+
***minor** (int64, required) - minor number of the device that will be limited
234
+
***weight** (uint16, optional) - bandwidth rate for the device, range is from 10 to 1000
235
+
***leafWeight** (uint16, optional) - bandwidth rate for the device while competing with the cgroup's child cgroups, range is from 10 to 1000, cfq scheduler only
236
+
237
+
You must specify at least one of `weight` or `leafWeight` in a given entry, and can specify both.
238
+
239
+
`blkioThrottleReadBpsDevice`, `blkioThrottleWriteBpsDevice`, `blkioThrottleReadIOPSDevice`, `blkioThrottleWriteIOPSDevice` (array, optional) - specify the list of devices on which IO rate limit will be applied. Next parameters can be specified per device:
240
+
241
+
***major** (int64, required) - major number of the device that will be limited
242
+
***minor** (int64, required) - minor number of the device that will be limited
243
+
***rate** (uint64, required) - IO rate limit for the device
0 commit comments