diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-11-01 13:04:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-01 13:04:10 -0700 |
commit | d18f243e121f13df99ed76c848405d1c88f55031 (patch) | |
tree | b4d63dfa9418edf29dbbac4b00ae397e93632299 /cmd/podman/shared/parallel.go | |
parent | 732a4c814e575ead4b39f00097f22b2f3b64bfc0 (diff) | |
parent | b559c19c2fa739cf1c8ede50eab8f5acf74f6bf3 (diff) | |
download | podman-d18f243e121f13df99ed76c848405d1c88f55031.tar.gz podman-d18f243e121f13df99ed76c848405d1c88f55031.tar.bz2 podman-d18f243e121f13df99ed76c848405d1c88f55031.zip |
Merge pull request #1737 from baude/parakill
Make kill, pause, and unpause parallel.
Diffstat (limited to 'cmd/podman/shared/parallel.go')
-rw-r--r-- | cmd/podman/shared/parallel.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cmd/podman/shared/parallel.go b/cmd/podman/shared/parallel.go index dbf43a982..633781a45 100644 --- a/cmd/podman/shared/parallel.go +++ b/cmd/podman/shared/parallel.go @@ -72,6 +72,16 @@ func ParallelExecuteWorkerPool(workers int, functions []ParallelWorkerInput) map func Parallelize(job string) int { numCpus := runtime.NumCPU() switch job { + case "kill": + if numCpus <= 3 { + return numCpus * 3 + } + return numCpus * 4 + case "pause": + if numCpus <= 3 { + return numCpus * 3 + } + return numCpus * 4 case "ps": return 8 case "restart": @@ -88,6 +98,11 @@ func Parallelize(job string) int { } else { return numCpus * 3 } + case "unpause": + if numCpus <= 3 { + return numCpus * 3 + } + return numCpus * 4 } return 3 } |