File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import (
23
23
"net"
24
24
"net/http"
25
25
"os"
26
+ "runtime"
26
27
"strings"
27
28
28
29
"sigs.k8s.io/blob-csi-driver/pkg/blob"
45
46
allowEmptyCloudConfig = flag .Bool ("allow-empty-cloud-config" , true , "allow running driver without cloud config" )
46
47
kubeAPIQPS = flag .Float64 ("kube-api-qps" , 25.0 , "QPS to use while communicating with the kubernetes apiserver." )
47
48
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" )
48
50
)
49
51
50
52
func init () {
53
+ klog .InitFlags (nil )
54
+ _ = flag .Set ("logtostderr" , "true" )
51
55
driverOptions .AddFlags ()
52
56
}
53
57
@@ -57,8 +61,6 @@ var exit = func(code int) {
57
61
}
58
62
59
63
func main () {
60
- klog .InitFlags (nil )
61
- _ = flag .Set ("logtostderr" , "true" )
62
64
flag .Parse ()
63
65
if * version {
64
66
info , err := blob .GetVersionYAML (driverOptions .DriverName )
@@ -74,6 +76,9 @@ func main() {
74
76
}
75
77
76
78
func handle () {
79
+ runtime .GOMAXPROCS (* goMaxProcs )
80
+ klog .Infof ("Sys info: NumCPU: %v MAXPROC: %v" , runtime .NumCPU (), runtime .GOMAXPROCS (0 ))
81
+
77
82
userAgent := blob .GetUserAgent (driverOptions .DriverName , * customUserAgent , * userAgentSuffix )
78
83
klog .V (2 ).Infof ("driver userAgent: %s" , userAgent )
79
84
You can’t perform that action at this time.
0 commit comments