Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.25] chore: set GoMaxProcs as 2 #1782

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pkg/blobplugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"net"
"net/http"
"os"
"runtime"
"strings"

"sigs.k8s.io/blob-csi-driver/pkg/blob"
Expand All @@ -45,15 +46,16 @@ var (
allowEmptyCloudConfig = flag.Bool("allow-empty-cloud-config", true, "allow running driver without cloud config")
kubeAPIQPS = flag.Float64("kube-api-qps", 25.0, "QPS to use while communicating with the kubernetes apiserver.")
kubeAPIBurst = flag.Int("kube-api-burst", 50, "Burst to use while communicating with the kubernetes apiserver.")
goMaxProcs = flag.Int("max-procs", 2, "maximum number of CPUs that can be executing simultaneously in golang runtime")
)

func init() {
klog.InitFlags(nil)
_ = flag.Set("logtostderr", "true")
driverOptions.AddFlags()
}

func main() {
klog.InitFlags(nil)
_ = flag.Set("logtostderr", "true")
flag.Parse()
if *version {
info, err := blob.GetVersionYAML(driverOptions.DriverName)
Expand All @@ -70,6 +72,9 @@ func main() {
}

func handle() {
runtime.GOMAXPROCS(*goMaxProcs)
klog.Infof("Sys info: NumCPU: %v MAXPROC: %v", runtime.NumCPU(), runtime.GOMAXPROCS(0))

userAgent := blob.GetUserAgent(driverOptions.DriverName, *customUserAgent, *userAgentSuffix)
klog.V(2).Infof("driver userAgent: %s", userAgent)

Expand Down
Loading