-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Description
This is a Bug Report
Problem:
Based on #52793 and documentation here we have some concerns about few details there.
This page references 1 CPU (1024m) in multiple places, which is misleading.
Conceptually, 1 core = 1000 millicores (1000m).
The value 1024 comes from cpu.shares in cgroup v1. The cpu.shares are just relative priority numbers, not millicores.
Treating 1024 as equivalent to 1024m is causing the confusion.
We're not sure why 1CPU is mentioned as 1024 milicores, unless we miss some key information.
Furthermore, in .NET Extensions we are doing some improvements to CPU measurements in Kubernetes.
Previously, we planned to take unit from yamls eg. 1CPU=1000milicores, and use it as denominator for usage=cpu.ticks/1CPU, but that wouldn't work with the changes to the formula. The reason is, when we reverse the formula to get CPUs from cpu.weight, then 102 cpu.weight (1CPU from yamls) will result in 1.02539062 cores, which is not the same as what we see in yamls. Should we rely then on yaml values at all?
Proposed Solution:
Clarification on how CPUs are translated to shares, as the documentation mainly clarifies calculations from shares to weight, we're missing second half of the documentation.
Page to Update:
https://kubernetes.io/...