Skip to content

Commit 7123c91

Browse files
committed
chore: set GoMaxProcs as 2
1 parent a91bcc1 commit 7123c91

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/blobplugin/main.go

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"net"
2424
"net/http"
2525
"os"
26+
"runtime"
2627
"strings"
2728

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

5052
func init() {
@@ -73,6 +75,9 @@ func main() {
7375
}
7476

7577
func handle() {
78+
runtime.GOMAXPROCS(*goMaxProcs)
79+
klog.Infof("Sys info: NumCPU: %v MAXPROC: %v", runtime.NumCPU(), runtime.GOMAXPROCS(0))
80+
7681
userAgent := blob.GetUserAgent(driverOptions.DriverName, *customUserAgent, *userAgentSuffix)
7782
klog.V(2).Infof("driver userAgent: %s", userAgent)
7883

0 commit comments

Comments
 (0)