SystemResources.GuaranteedCpuUnits 属性

定义

获取系统中可用的 CPU 单位。

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

属性值

注解

此值对应于 Kubernetes CPU 请求参数所述的保证 CPU 数,每个 1000 个 CPU 单元表示 1 个 CPU 或 1 核。 例如,如果将 POD 配置为 1500m 单位作为 CPU 请求,则此属性将分配给 1.5,这意味着一个半 CPU 将专用于 POD。 对于 POD,此值基于 cgroupv2 权重(使用 公式)计算。 y = (1 + ( (x - 2) * 9999) /262142) ,其中 y 是 CPU 权重,x 是 cgroup v1) (CPU 共享。 https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2254-cgroup-v2#phase-1-convert-from-cgroups-v1-settings-to-v2.

适用于