github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/options/cpu-shares.md (about) 1 ####> This option file is used in: 2 ####> podman build, container clone, create, farm build, pod clone, pod create, run, update 3 ####> If file is edited, make sure the changes 4 ####> are applicable to all of those. 5 #### **--cpu-shares**, **-c**=*shares* 6 7 CPU shares (relative weight). 8 9 By default, all containers get the same proportion of CPU cycles. This 10 proportion can be modified by changing the container's CPU share weighting 11 relative to the combined weight of all the running containers. 12 Default weight is **1024**. 13 14 The proportion only applies when CPU-intensive processes are running. 15 When tasks in one container are idle, other containers can use the 16 left-over CPU time. The actual amount of CPU time varies depending on 17 the number of containers running on the system. 18 19 For example, consider three containers, one has a cpu-share of 1024 and 20 two others have a cpu-share setting of 512. When processes in all three 21 containers attempt to use 100% of CPU, the first container receives 22 50% of the total CPU time. If a fourth container is added with a cpu-share 23 of 1024, the first container only gets 33% of the CPU. The remaining containers 24 receive 16.5%, 16.5% and 33% of the CPU. 25 26 On a multi-core system, the shares of CPU time are distributed over all CPU 27 cores. Even if a container is limited to less than 100% of CPU time, it can 28 use 100% of each individual CPU core. 29 30 For example, consider a system with more than three cores. 31 If the container _C0_ is started with **--cpu-shares=512** running one process, 32 and another container _C1_ with **--cpu-shares=1024** running two processes, 33 this can result in the following division of CPU shares: 34 35 | PID | container | CPU | CPU share | 36 | ---- | ----------- | ------- | ------------ | 37 | 100 | C0 | 0 | 100% of CPU0 | 38 | 101 | C1 | 1 | 100% of CPU1 | 39 | 102 | C1 | 2 | 100% of CPU2 | 40 41 On some systems, changing the resource limits may not be allowed for non-root 42 users. For more details, see 43 https://github.com/containers/podman/blob/main/troubleshooting.md#26-running-containers-with-resource-limits-fails-with-a-permissions-error 44 45 This option is not supported on cgroups V1 rootless systems.