From 7d007ca1d46b42394e5cc69f92bbc5792cb2e770 Mon Sep 17 00:00:00 2001 From: Darren Stahl Date: Fri, 21 Apr 2017 14:12:21 -0700 Subject: [PATCH] Change Windows CPU Percent to Maximum In order to increase the granularity of CPU resource control, change the CPU Percent (0-100) resource setting to CPU Maximum (0-10000) Signed-off-by: Darren Stahl --- config-windows.md | 4 ++-- schema/config-windows.json | 6 +++--- specs-go/config.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config-windows.md b/config-windows.md index ab3c8dfad..a51a4334f 100644 --- a/config-windows.md +++ b/config-windows.md @@ -40,7 +40,7 @@ The following parameters can be specified: * **`shares`** *(uint16, OPTIONAL)* - specifies the relative weight to other containers with CPU shares. -* **`percent`** *(uint, OPTIONAL)* - specifies the percentage of available CPUs usable by the container. +* **`maximum`** *(uint, OPTIONAL)* - specifies the portion of processor cycles that this container can use as a percentage times 100. #### Example @@ -48,7 +48,7 @@ The following parameters can be specified: "windows": { "resources": { "cpu": { - "percent": 50 + "maximum": 5000 } } } diff --git a/schema/config-windows.json b/schema/config-windows.json index 38f7d6045..bd90b5c2f 100644 --- a/schema/config-windows.json +++ b/schema/config-windows.json @@ -34,9 +34,9 @@ "id": "https://opencontainers.org/schema/bundle/windows/resources/cpu/shares", "$ref": "defs-windows.json#/definitions/cpuShares" }, - "percent": { - "id": "https://opencontainers.org/schema/bundle/windows/resources/cpu/percent", - "$ref": "defs.json#/definitions/percent" + "maximum": { + "id": "https://opencontainers.org/schema/bundle/windows/resources/cpu/maximum", + "$ref": "defs.json#/definitions/uint16" } } }, diff --git a/specs-go/config.go b/specs-go/config.go index c9f7d67d1..da9040594 100644 --- a/specs-go/config.go +++ b/specs-go/config.go @@ -460,8 +460,8 @@ type WindowsCPUResources struct { Count *uint64 `json:"count,omitempty"` // CPU shares (relative weight to other containers with cpu shares). Range is from 1 to 10000. Shares *uint16 `json:"shares,omitempty"` - // Percent of available CPUs usable by the container. - Percent *uint8 `json:"percent,omitempty"` + // Specifies the portion of processor cycles that this container can use as a percentage times 100. + Maximum *uint16 `json:"maximum,omitempty"` } // WindowsStorageResources contains storage resource management settings.