From 1fef707c4d004d80523774ce737e0391e2b8f9c7 Mon Sep 17 00:00:00 2001 From: Justin Terry Date: Wed, 13 Apr 2022 09:26:45 -0700 Subject: [PATCH] Update Windows CPU comments Signed-off-by: Justin Terry --- config-windows.md | 10 ++++++---- specs-go/config.go | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/config-windows.md b/config-windows.md index 16ac428db..73a6d639e 100644 --- a/config-windows.md +++ b/config-windows.md @@ -77,11 +77,13 @@ The following parameters can be specified: `cpu` is an OPTIONAL configuration for the container's CPU usage. -The following parameters can be specified: +The following parameters can be specified (mutually exclusive): + +* **`count`** *(uint64, OPTIONAL)* - specifies the number of CPUs available to the container. It represents the fraction of the configured processor `count` in a container in relation to the processors available in the host. The fraction ultimately determines the portion of processor cycles that the threads in a container can use during each scheduling interval, as the number of cycles per 10,000 cycles. +* **`shares`** *(uint16, OPTIONAL)* - limits the share of processor time given to the container relative to other workloads on the processor. The processor `shares` (`weight` at the platform level) is a value between 0 and 10,000. +* **`maximum`** *(uint16, OPTIONAL)* - determines the portion of processor cycles that the threads in a container can use during each scheduling interval, as the number of cycles per 10,000 cycles. Set processor `maximum` to a percentage times 100. -* **`count`** *(uint64, OPTIONAL)* - specifies the number of CPUs available to the container. -* **`shares`** *(uint16, OPTIONAL)* - specifies the relative weight to other containers with CPU shares. -* **`maximum`** *(uint16, OPTIONAL)* - specifies the portion of processor cycles that this container can use as a percentage times 100. +Ref: https://docs.microsoft.com/en-us/virtualization/api/hcs/schemareference#Container_Processor #### Example diff --git a/specs-go/config.go b/specs-go/config.go index c0e879448..933aea0c2 100644 --- a/specs-go/config.go +++ b/specs-go/config.go @@ -524,11 +524,21 @@ type WindowsMemoryResources struct { // WindowsCPUResources contains CPU resource management settings. type WindowsCPUResources struct { - // Number of CPUs available to the container. + // Count is the number of CPUs available to the container. It represents the + // fraction of the configured processor `count` in a container in relation + // to the processors available in the host. The fraction ultimately + // determines the portion of processor cycles that the threads in a + // container can use during each scheduling interval, as the number of + // cycles per 10,000 cycles. Count *uint64 `json:"count,omitempty"` - // CPU shares (relative weight to other containers with cpu shares). + // Shares limits the share of processor time given to the container relative + // to other workloads on the processor. The processor `shares` (`weight` at + // the platform level) is a value between 0 and 10000. Shares *uint16 `json:"shares,omitempty"` - // Specifies the portion of processor cycles that this container can use as a percentage times 100. + // Maximum determines the portion of processor cycles that the threads in a + // container can use during each scheduling interval, as the number of + // cycles per 10,000 cycles. Set processor `maximum` to a percentage times + // 100. Maximum *uint16 `json:"maximum,omitempty"` }