SystemResources.GuaranteedCpuUnits Property

Definition

Gets the CPU units available in the system.

public:
 property double GuaranteedCpuUnits { double get(); };
public double GuaranteedCpuUnits { get; }
member this.GuaranteedCpuUnits : double
Public ReadOnly Property GuaranteedCpuUnits As Double

Property Value

Remarks

This value corresponds to the number of the guaranteed CPUs as described by Kubernetes CPU request parameter. Each 1000 CPU units represent 1 CPU or 1 Core. For example, if the Pod is configured with 1500m units as the CPU request, this property will be assigned to 1.5, which means one and a half CPU will be dedicated for the Pod. For a Pod, this value is calculated based on the cgroupv2 weight, using the formula y = (1 + ((x - 2) * 9999) / 262142), where y is the CPU weight and x is the CPU share (cgroup v1). For more information, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2254-cgroup-v2#phase-1-convert-from-cgroups-v1-settings-to-v2.

Applies to