Skip to content

Commit 7c04f3a

Browse files
authored
bump worker threads for node-vm attachment and batch attachment (#3664)
1 parent 1a0b8f2 commit 7c04f3a

File tree

8 files changed

+20
-21
lines changed

8 files changed

+20
-21
lines changed

manifests/supervisorcluster/1.29/cns-csi.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,10 @@ spec:
485485
value: "30"
486486
- name: VOLUME_HEALTH_INTERVAL_MINUTES
487487
value: "5"
488+
- name: WORKER_THREADS_NODEVM_ATTACH
489+
value: "20"
490+
- name: WORKER_THREADS_NODEVM_BATCH_ATTACH
491+
value: "20"
488492
- name: POD_POLL_INTERVAL_SECONDS
489493
value: "2"
490494
- name: POD_LISTENER_SERVICE_PORT

manifests/supervisorcluster/1.30/cns-csi.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,10 @@ spec:
488488
value: "30"
489489
- name: VOLUME_HEALTH_INTERVAL_MINUTES
490490
value: "5"
491+
- name: WORKER_THREADS_NODEVM_ATTACH
492+
value: "20"
493+
- name: WORKER_THREADS_NODEVM_BATCH_ATTACH
494+
value: "20"
491495
- name: POD_POLL_INTERVAL_SECONDS
492496
value: "2"
493497
- name: POD_LISTENER_SERVICE_PORT

manifests/supervisorcluster/1.31/cns-csi.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,10 @@ spec:
488488
value: "30"
489489
- name: VOLUME_HEALTH_INTERVAL_MINUTES
490490
value: "5"
491+
- name: WORKER_THREADS_NODEVM_ATTACH
492+
value: "20"
493+
- name: WORKER_THREADS_NODEVM_BATCH_ATTACH
494+
value: "20"
491495
- name: POD_POLL_INTERVAL_SECONDS
492496
value: "2"
493497
- name: POD_LISTENER_SERVICE_PORT

manifests/supervisorcluster/1.32/cns-csi.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,10 @@ spec:
488488
value: "30"
489489
- name: VOLUME_HEALTH_INTERVAL_MINUTES
490490
value: "5"
491+
- name: WORKER_THREADS_NODEVM_ATTACH
492+
value: "20"
493+
- name: WORKER_THREADS_NODEVM_BATCH_ATTACH
494+
value: "20"
491495
- name: POD_POLL_INTERVAL_SECONDS
492496
value: "2"
493497
- name: POD_LISTENER_SERVICE_PORT

pkg/syncer/cnsoperator/controller/cnsnodevmattachment/cnsnodevmattachment_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import (
5858

5959
const (
6060
workerThreadsEnvVar = "WORKER_THREADS_NODEVM_ATTACH"
61-
defaultMaxWorkerThreads = 10
61+
defaultMaxWorkerThreads = 20
6262
)
6363

6464
// backOffDuration is a map of cnsnodevmattachment name's to the time after

pkg/syncer/cnsoperator/controller/cnsnodevmbatchattachment/cnsnodevmbatchattachment_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var (
7575

7676
const (
7777
workerThreadsEnvVar = "WORKER_THREADS_NODEVM_BATCH_ATTACH"
78-
defaultMaxWorkerThreads = 10
78+
defaultMaxWorkerThreads = 20
7979
)
8080

8181
var newClientFunc = func(ctx context.Context) (kubernetes.Interface, error) {

pkg/syncer/cnsoperator/util/util.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,7 @@ func GetDatacenterObjectList(ctx context.Context,
368368
// spawned by a controller to reconciler instances of a CRD. It reads the
369369
// value from an environment variable identified by 'key'. If the environment
370370
// variable is not set or has an invalid value, it returns the 'defaultVal'.
371-
// The value of the environment variable should be a positive integer less
372-
// than or equal to 'defaultVal'.
371+
// The value of the environment variable should be a positive integer
373372
func GetMaxWorkerThreads(ctx context.Context, key string, defaultVal int) int {
374373
log := logger.GetLogger(ctx).With("field", key)
375374
workerThreads := defaultVal
@@ -388,7 +387,7 @@ func GetMaxWorkerThreads(ctx context.Context, key string, defaultVal int) int {
388387
}
389388

390389
switch {
391-
case val <= 0 || val > defaultVal:
390+
case val <= 0:
392391
log.Warnf("Value %d for environment variable is invalid. Using default value %d",
393392
val, defaultVal)
394393
default:

pkg/syncer/cnsoperator/util/util_test.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -185,20 +185,4 @@ func TestGetMaxWorkerThreads(t *testing.T) {
185185
// Assert
186186
assert.Equal(t, expVal, val)
187187
})
188-
189-
t.Run("WhenEnvValid", func(t *testing.T) {
190-
// Setup
191-
err := os.Setenv(envVar, "10")
192-
if err != nil {
193-
t.Fatalf("Failed to set env var: %v", err)
194-
}
195-
196-
defVal, expVal := 50, 10
197-
198-
// Execute
199-
val := GetMaxWorkerThreads(context.Background(), envVar, defVal)
200-
201-
// Assert
202-
assert.Equal(t, expVal, val)
203-
})
204188
}

0 commit comments

Comments
 (0)