Skip to content

Commit

Permalink
chore: set GoMaxProcs as 2
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
andyzhangx committed Jan 4, 2025
1 parent a91bcc1 commit f2816a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 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,10 +46,12 @@ 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()
}

Expand All @@ -73,6 +76,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

0 comments on commit f2816a6

Please sign in to comment.