Browse code

Merge pull request #17949 from Microsoft/jjh/cpuweighttp4

Windows: TP4 fix cpu weight

Vincent Demeester authored on 2015/11/13 05:13:09
Showing 2 changed files
... ...
@@ -19,7 +19,7 @@ const (
19 19
 	defaultVirtualSwitch = "Virtual Switch"
20 20
 	platformSupported    = true
21 21
 	windowsMinCPUShares  = 1
22
-	windowsMaxCPUShares  = 9
22
+	windowsMaxCPUShares  = 10000
23 23
 )
24 24
 
25 25
 func getBlkioWeightDevices(config *runconfig.HostConfig) ([]*blkiodev.WeightDevice, error) {
... ...
@@ -74,7 +74,7 @@ type containerInit struct {
74 74
 	IgnoreFlushesDuringBoot bool        // Optimisation hint for container startup in Windows
75 75
 	LayerFolderPath         string      // Where the layer folders are located
76 76
 	Layers                  []layer     // List of storage layers
77
-	ProcessorWeight         int64       // CPU Shares 1..9 on Windows; or 0 is platform default.
77
+	ProcessorWeight         int64       `json:",omitempty"` // CPU Shares 0..10000 on Windows; where 0 will be ommited and HCS will default.
78 78
 	HostName                string      // Hostname
79 79
 	MappedDirectories       []mappedDir // List of mapped directories (volumes/mounts)
80 80
 	SandboxPath             string      // Location of unmounted sandbox (used for Hyper-V containers, not Windows Server containers)