Skip to content

Commit

Permalink
Merge pull request #1798 from stevvooe/shim-gomaxprocs
Browse files Browse the repository at this point in the history
cmd/containerd-shim: set GOMAXPROCS to 2
  • Loading branch information
crosbymichael committed Nov 28, 2017
2 parents 372cdfa + 5764bf1 commit ca39f76
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/containerd-shim/main_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ func main() {
if debugFlag {
logrus.SetLevel(logrus.DebugLevel)
}

if os.Getenv("GOMAXPROCS") == "" {
// If GOMAXPROCS hasn't been set, we default to a value of 2 to reduce
// the number of Go stacks present in the shim.
runtime.GOMAXPROCS(2)
}

if err := executeShim(); err != nil {
fmt.Fprintf(os.Stderr, "containerd-shim: %s\n", err)
os.Exit(1)
Expand Down

0 comments on commit ca39f76

Please sign in to comment.