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

Commit 1a451ca

Browse files
authored
Merge pull request #423 from thaJeztah/19.03_backport_win_restore_no_parallelism
[19.03 backport] Windows: Use system specific parallelism value on containers restart
2 parents cf14fa7 + e1cae01 commit 1a451ca

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"
@@ -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)