Skip to content

Commit 447a840

Browse files
committed
Windows: Use system specific parallelism value on containers restart
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
1 parent 36ffe9e commit 447a840

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

daemon/daemon_windows.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ package daemon // import "github.com/docker/docker/daemon"
33
import (
44
"context"
55
"fmt"
6+
"math"
67
"path/filepath"
8+
"runtime"
79
"strings"
810

911
"github.com/Microsoft/hcsshim"
@@ -41,9 +43,10 @@ const (
4143
windowsMaxCPUPercent = 100
4244
)
4345

44-
// Windows doesn't really have rlimits.
46+
// Windows containers are much larger than Linux containers and each of them
47+
// have > 20 system processes which why we use much smaller parallelism value.
4548
func adjustParallelLimit(n int, limit int) int {
46-
return limit
49+
return int(math.Max(1, math.Floor(float64(runtime.NumCPU())*.8)))
4750
}
4851

4952
// Windows has no concept of an execution state directory. So use config.Root here.

0 commit comments

Comments
 (0)