From 1e679f0069f629d76fcab6f9f39ef0efc1814cc4 Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Fri, 20 Feb 2015 11:22:46 -0800 Subject: [PATCH] Add GOMAXPROCS in a few more places --- cmd/hyperkube/hyperkube.go | 3 +++ plugin/cmd/kube-scheduler/scheduler.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cmd/hyperkube/hyperkube.go b/cmd/hyperkube/hyperkube.go index d8499e5990b..fefbde22f61 100644 --- a/cmd/hyperkube/hyperkube.go +++ b/cmd/hyperkube/hyperkube.go @@ -24,6 +24,7 @@ import ( "io/ioutil" "os" "path" + "runtime" "github.com/GoogleCloudPlatform/kubernetes/pkg/util" "github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag" @@ -175,8 +176,10 @@ func (hk *HyperKube) Run(args []string) error { // RunToExit will run the hyperkube and then call os.Exit with an appropriate exit code. func (hk *HyperKube) RunToExit(args []string) { + runtime.GOMAXPROCS(runtime.NumCPU()) err := hk.Run(args) if err != nil { + fmt.Fprint(os.Stderr, err.Error()) os.Exit(1) } os.Exit(0) diff --git a/plugin/cmd/kube-scheduler/scheduler.go b/plugin/cmd/kube-scheduler/scheduler.go index eb62343a7e6..ade8ff6135d 100644 --- a/plugin/cmd/kube-scheduler/scheduler.go +++ b/plugin/cmd/kube-scheduler/scheduler.go @@ -17,6 +17,8 @@ limitations under the License. package main import ( + "runtime" + "github.com/GoogleCloudPlatform/kubernetes/pkg/util" "github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag" "github.com/GoogleCloudPlatform/kubernetes/plugin/cmd/kube-scheduler/app" @@ -25,6 +27,7 @@ import ( ) func main() { + runtime.GOMAXPROCS(runtime.NumCPU()) s := app.NewSchedulerServer() s.AddFlags(pflag.CommandLine)