Add support cpu cfs quota

Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
Lei Jitang 2015-04-20 08:16:47 -07:00 committed by Tibor Vass
parent f00c5d0720
commit 6c60a3415c
3 changed files with 13 additions and 0 deletions

View File

@ -770,6 +770,7 @@ _docker_run() {
--cidfile
--cpuset
--cpu-shares -c
--cpu-quota
--device
--dns
--dns-search

View File

@ -925,6 +925,7 @@ Creates a new container.
--cidfile="" Write the container ID to the file
--cpuset-cpus="" CPUs in which to allow execution (0-3, 0,1)
--cpuset-mems="" Memory nodes (MEMs) in which to allow execution (0-3, 0,1)
--cpu-quota=0 Limit the CPU CFS (Completely Fair Scheduler) quota
--device=[] Add a host device to the container
--dns=[] Set custom DNS servers
--dns-search=[] Set custom DNS search domains
@ -1879,6 +1880,7 @@ To remove an image using its digest:
--cidfile="" Write the container ID to the file
--cpuset-cpus="" CPUs in which to allow execution (0-3, 0,1)
--cpuset-mems="" Memory nodes (MEMs) in which to allow execution (0-3, 0,1)
--cpu-quota=0 Limit the CPU CFS (Completely Fair Scheduler) quota
-d, --detach=false Run container in background and print container ID
--device=[] Add a host device to the container
--dns=[] Set custom DNS servers

View File

@ -475,6 +475,7 @@ container:
-c, --cpu-shares=0: CPU shares (relative weight)
--cpuset-cpus="": CPUs in which to allow execution (0-3, 0,1)
--cpuset-mems="": Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
--cpu-quota=0: Limit the CPU CFS (Completely Fair Scheduler) quota
### Memory constraints
@ -615,6 +616,15 @@ memory nodes 1 and 3.
This example restricts the processes in the container to only use memory from
memory nodes 0, 1 and 2.
### CPU quota constraint
The `--cpu-quota` flag limits the container's CPU usage. The default 0 value
allows the container to take 100% of a CPU resource (1 CPU). The CFS (Completely Fair
Scheduler) handles resource allocation for executing processes and is default
Linux Scheduler used by the kernel. Set this value to 50000 to limit the container
to 50% of a CPU resource. For multiple CPUs, adjust the `--cpu-quota` as necessary.
For more information, see the [CFS documentation on bandwidth limiting](https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt).
## Runtime privilege, Linux capabilities, and LXC configuration
--cap-add: Add Linux capabilities