We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 36ffe9e commit 447a840Copy full SHA for 447a840
1 file changed
daemon/daemon_windows.go
@@ -3,7 +3,9 @@ package daemon // import "github.com/docker/docker/daemon"
3
import (
4
"context"
5
"fmt"
6
+ "math"
7
"path/filepath"
8
+ "runtime"
9
"strings"
10
11
"github.com/Microsoft/hcsshim"
@@ -41,9 +43,10 @@ const (
41
43
windowsMaxCPUPercent = 100
42
44
)
45
-// 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.
48
func adjustParallelLimit(n int, limit int) int {
- return limit
49
+ return int(math.Max(1, math.Floor(float64(runtime.NumCPU())*.8)))
50
}
51
52
// Windows has no concept of an execution state directory. So use config.Root here.
0 commit comments