Merge pull request #1798 from stevvooe/shim-gomaxprocs

cmd/containerd-shim: set GOMAXPROCS to 2
This commit is contained in:
Michael Crosby 2017-11-28 09:55:31 -05:00 committed by GitHub
commit ca39f76f82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,6 +60,13 @@ func main() {
if debugFlag { if debugFlag {
logrus.SetLevel(logrus.DebugLevel) 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 { if err := executeShim(); err != nil {
fmt.Fprintf(os.Stderr, "containerd-shim: %s\n", err) fmt.Fprintf(os.Stderr, "containerd-shim: %s\n", err)
os.Exit(1) os.Exit(1)