Difference between revisions of "Docker run --cpu-shares"

From wikieduonline
Jump to navigation Jump to search
m (Welcome moved page --cpu-shares to Docker run --cpu-shares)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{lc}}
 +
* https://docs.docker.com/config/containers/resource_constraints/
 +
* https://docs.docker.com/engine/reference/run/#runtime-constraints-on-resources
  
 +
Set this flag to a value greater or less than the default of 1024 to increase or reduce the container’s weight, and give it access to a greater or lesser proportion of the host machine’s CPU cycles. This is only enforced when CPU cycles are constrained. When plenty of CPU cycles are available, all containers use as much CPU as they need. In that way, this is a soft limit. --cpu-shares does not prevent containers from being scheduled in [[swarm mode]]. It prioritizes container CPU resources for the available CPU cycles. It does not guarantee or reserve any specific CPU access.
  
[[docker run --cpus]]
+
  [[docker inspect]] xxxx | grep [[CpuShares]]
  
 +
== Related ==
 +
* <code>[[docker run --cpus]]</code>
  
 
+
== See also ==
 
+
* {{docker run}}
 
 
{{docker run}}
 

Latest revision as of 15:14, 12 July 2023

Set this flag to a value greater or less than the default of 1024 to increase or reduce the container’s weight, and give it access to a greater or lesser proportion of the host machine’s CPU cycles. This is only enforced when CPU cycles are constrained. When plenty of CPU cycles are available, all containers use as much CPU as they need. In that way, this is a soft limit. --cpu-shares does not prevent containers from being scheduled in swarm mode. It prioritizes container CPU resources for the available CPU cycles. It does not guarantee or reserve any specific CPU access.
 docker inspect xxxx | grep CpuShares

Related[edit]

See also[edit]

Advertising: