SystemResources.GuaranteedCpuUnits 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得系統中可用的 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,意即 Pod 會有一個半 CPU 專用。 對於 Pod,這個值是根據 cgroupv2 權重計算,公式為 y = (1 + ((x - 2) * 9999) / 262142),其中 y 是 CPU 權重, x 是 CPU 佔比 (cgroup v1)。 如需詳細資訊,請參閱https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2254-cgroup-v2#phase-1-convert-from-cgroups-v1-settings-to-v2。