How --cpu-share actually works in pod level? #27050
Unanswered
RyougiShiki-214
asked this question in
Q&A
Replies: 1 comment 3 replies
-
cpu shares/weight are related to their siblings cgroups. so if you have: graph TD;
A-->B;
A-->C;
B[B <br /> 1024] --> D[D <br /> ...];
B --> E[E <br /> ...];
C[C <br /> 1024] --> F[F <br /> 2048];
C --> G[G <br /> 1024];
The weight you assign to D and E does not affect F and G at all. B and C gets 50% each of the cpu cyles assigned to A. F gets 2/3 of the cpu cycles assigned to C, and G gets 1/3. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Suppose we created pods foo and bar with the cpu share settings in this table:
Detailed command
Pod
foo
(Pod level set --cpu-share 512)Pod
bar
(Pod level set --cpu-share 512)Now, suppose there's X unit of cpu time in total for podman, how --cpu-share actually works? There are 4 guesses:
foo and containers in foo get 50% X in total, bar and containers in bar get 50% X in total. Then containers divide up the cpu time got by their pod, the default --cpu-share of container is 1024:
Pod foo got 50%X in total
Pod bar got 50%X in total
foo and containers in foo get 50% X in total, bar and containers in bar get 50% X in total. Then containers divide up the cpu time got by their pod, the default --cpu-share of container is Pod's --cpu-share value:
Pod foo got 50%X in total
Pod bar got 50%X in total
Pods do not get any cpu time (X). Then containers divide up the cpu time (X) directly, the default --cpu-share of container is 1024:
Pods do not get any cpu time (X). Then containers divide up the cpu time (X) directly, the default --cpu-share of container is Pod's --cpu-share value:
I tried to ask Gemini, ChatGPT, Claude Sonnet, DeepSeek, Qwen, Github Copilot, anyway their answers are different, three of them support guess 1, two of them support guess 3, and one of them support guess 4.
Generally, there has been a serious divergence of opinions among different LLMs, which made me comfused... So, I think it's time to seek help from real human.
Beta Was this translation helpful? Give feedback.
All reactions