We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 279ff2c commit 8e7a61bCopy full SHA for 8e7a61b
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"
@@ -40,9 +42,10 @@ const (
40
42
windowsMaxCPUPercent = 100
41
43
)
44
-// 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.
47
func adjustParallelLimit(n int, limit int) int {
- return limit
48
+ return int(math.Max(1, math.Floor(float64(runtime.NumCPU())*.8)))
49
}
50
51
// Windows has no concept of an execution state directory. So use config.Root here.
0 commit comments