Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
| ... | ... |
@@ -448,14 +448,15 @@ Note: |
| 448 | 448 |
|
| 449 | 449 |
You would have to write policy defining a `svirt_apache_t` type. |
| 450 | 450 |
|
| 451 |
-## Runtime constraints on CPU and memory |
|
| 451 |
+## Runtime constraints on resources |
|
| 452 | 452 |
|
| 453 | 453 |
The operator can also adjust the performance parameters of the |
| 454 | 454 |
container: |
| 455 | 455 |
|
| 456 |
- -m="": Memory limit (format: <number><optional unit>, where unit = b, k, m or g) |
|
| 456 |
+ -m, --memory="": Memory limit (format: <number><optional unit>, where unit = b, k, m or g) |
|
| 457 | 457 |
-memory-swap="": Total memory limit (memory + swap, format: <number><optional unit>, where unit = b, k, m or g) |
| 458 | 458 |
-c, --cpu-shares=0: CPU shares (relative weight) |
| 459 |
+ --cpuset-cpus="": CPUs in which to allow execution (0-3, 0,1) |
|
| 459 | 460 |
|
| 460 | 461 |
### Memory constraints |
| 461 | 462 |
|
| ... | ... |
@@ -567,6 +568,20 @@ division of CPU shares: |
| 567 | 567 |
101 {C1} 1 100% of CPU1
|
| 568 | 568 |
102 {C1} 2 100% of CPU2
|
| 569 | 569 |
|
| 570 |
+### Cpuset constraint |
|
| 571 |
+ |
|
| 572 |
+We can set cpus in which to allow execution for containers. |
|
| 573 |
+ |
|
| 574 |
+Examples: |
|
| 575 |
+ |
|
| 576 |
+ $ sudo docker run -ti --cpuset-cpus="1,3" ubuntu:14.04 /bin/bash |
|
| 577 |
+ |
|
| 578 |
+This means processes in container can be executed on cpu 1 and cpu 3. |
|
| 579 |
+ |
|
| 580 |
+ $ sudo docker run -ti --cpuset-cpus="0-2" ubuntu:14.04 /bin/bash |
|
| 581 |
+ |
|
| 582 |
+This means processes in container can be executed on cpu 0, cpu 1 and cpu 2. |
|
| 583 |
+ |
|
| 570 | 584 |
## Runtime privilege, Linux capabilities, and LXC configuration |
| 571 | 585 |
|
| 572 | 586 |
--cap-add: Add Linux capabilities |