mirror of
https://github.com/docker/cli.git
synced 2026-09-24 15:30:10 -05:00
Add support cpu cfs quota
Signed-off-by: Lei Jitang <leijitang@huawei.com> Upstream-commit: dcc50e1d593fd7995189872791c6d7a013f16970 Component: engine
This commit is contained in:
@@ -14,6 +14,7 @@ docker-create - Create a new container
|
||||
[**--cidfile**[=*CIDFILE*]]
|
||||
[**--cpuset-cpus**[=*CPUSET-CPUS*]]
|
||||
[**--cpuset-mems**[=*CPUSET-MEMS*]]
|
||||
[**--cpu-quota**[=*0*]]
|
||||
[**--device**[=*[]*]]
|
||||
[**--dns-search**[=*[]*]]
|
||||
[**--dns**[=*[]*]]
|
||||
@@ -82,6 +83,9 @@ IMAGE [COMMAND] [ARG...]
|
||||
then processes in your Docker container will only use memory from the first
|
||||
two memory nodes.
|
||||
|
||||
**-cpu-quota**=0
|
||||
Limit the CPU CFS (Completely Fair Scheduler) quota
|
||||
|
||||
**--device**=[]
|
||||
Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm)
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ docker-run - Run a command in a new container
|
||||
[**--cpuset-cpus**[=*CPUSET-CPUS*]]
|
||||
[**--cpuset-mems**[=*CPUSET-MEMS*]]
|
||||
[**-d**|**--detach**[=*false*]]
|
||||
[**--cpu-quota**[=*0*]]
|
||||
[**--device**[=*[]*]]
|
||||
[**--dns-search**[=*[]*]]
|
||||
[**--dns**[=*[]*]]
|
||||
@@ -142,6 +143,13 @@ division of CPU shares:
|
||||
then processes in your Docker container will only use memory from the first
|
||||
two memory nodes.
|
||||
|
||||
**--cpu-quota**=0
|
||||
Limit the CPU CFS (Completely Fair Scheduler) quota
|
||||
|
||||
Limit the container's CPU usage. By default, containers run with the full
|
||||
CPU resource. This flag tell the kernel to restrict the container's CPU usage
|
||||
to the quota you specify.
|
||||
|
||||
**-d**, **--detach**=*true*|*false*
|
||||
Detached mode: run the container in the background and print the new container ID. The default is *false*.
|
||||
|
||||
|
||||
@@ -894,6 +894,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
|
||||
@@ -1847,6 +1848,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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user