Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 1232d6d

Browse files
olljanatthaJeztah
authored andcommitted
Windows: Use system specific parallelism value on containers restart
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com> (cherry picked from commit 447a840254410df3b9345c652b601f08447b8467) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: e1cae011e2d83ab0c0bbcddf0c59ef6d8b6f6e42 Component: engine
1 parent 78173b2 commit 1232d6d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

components/engine/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"
@@ -40,9 +42,10 @@ const (
4042
windowsMaxCPUPercent = 100
4143
)
4244

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

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

0 commit comments

Comments
 (0)