mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
Add GOMAXPROCS in a few more places
This commit is contained in:
parent
17feadf977
commit
1e679f0069
@ -24,6 +24,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag"
|
"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.
|
// RunToExit will run the hyperkube and then call os.Exit with an appropriate exit code.
|
||||||
func (hk *HyperKube) RunToExit(args []string) {
|
func (hk *HyperKube) RunToExit(args []string) {
|
||||||
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||||
err := hk.Run(args)
|
err := hk.Run(args)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
fmt.Fprint(os.Stderr, err.Error())
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
@ -17,6 +17,8 @@ limitations under the License.
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/plugin/cmd/kube-scheduler/app"
|
"github.com/GoogleCloudPlatform/kubernetes/plugin/cmd/kube-scheduler/app"
|
||||||
@ -25,6 +27,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||||
s := app.NewSchedulerServer()
|
s := app.NewSchedulerServer()
|
||||||
s.AddFlags(pflag.CommandLine)
|
s.AddFlags(pflag.CommandLine)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user