共用方式為


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.

適用於