While investigating some CPU pressure issues I looked into how container_spec_cpu_shares metric is calculated. The formula is 2 + ((weight-1)*262142)/9999 from https://github.com/google/cadvisor/blob/master/container/common/helpers.go#L263. With a CPU weight of 1 this translates to 2. The next jump would be 2 to 28.
My question is this really an accurate representation of weights (or k8s requests) at the lower range of the spectrum? If a machine has many cores wouldn't the weight of 1 translate into a much higher value than 2 (assuming that we are splitting all of the cores 10000 ways)?
While investigating some CPU pressure issues I looked into how
container_spec_cpu_shares
metric is calculated. The formula is2 + ((weight-1)*262142)/9999
from https://github.com/google/cadvisor/blob/master/container/common/helpers.go#L263. With a CPU weight of1
this translates to2
. The next jump would be2
to28
.My question is this really an accurate representation of weights (or k8s requests) at the lower range of the spectrum? If a machine has many cores wouldn't the weight of 1 translate into a much higher value than
2
(assuming that we are splitting all of the cores 10000 ways)?