From d683edd8eeab60731d0d73c2d9e0a5607a250e8f Mon Sep 17 00:00:00 2001 From: Marco Iorio Date: Wed, 3 Jul 2024 17:35:40 +0200 Subject: [PATCH] cmapisrv-mock: configure bootstrap QPS to speed-up initial synch Configure by default higher rate limiter settings during the bootstrap phase, to speed it up as no watchers are active yet at that point. Signed-off-by: Marco Iorio --- .../deploy/cmapisrv-mock/templates/deployment.yaml | 1 + cmapisrv-mock/deploy/cmapisrv-mock/values.yaml | 1 + cmapisrv-mock/internal/mocker/cells.go | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmapisrv-mock/deploy/cmapisrv-mock/templates/deployment.yaml b/cmapisrv-mock/deploy/cmapisrv-mock/templates/deployment.yaml index 64bc5e5c..5da6736e 100644 --- a/cmapisrv-mock/deploy/cmapisrv-mock/templates/deployment.yaml +++ b/cmapisrv-mock/deploy/cmapisrv-mock/templates/deployment.yaml @@ -115,6 +115,7 @@ spec: - --random-svc-ip6={{ .Values.config.randomSvcIP6 }} - --kvstore-opt=etcd.config=/var/lib/cilium/etcd-config.yaml - --kvstore-opt=etcd.qps={{ .Values.config.etcdQPS }} + - --kvstore-opt=etcd.bootstrapQps={{ .Values.config.etcdBootstrapQPS }} - --kvstore-opt=etcd.maxInflight={{ .Values.config.etcdMaxInflight }} - --prometheus-serve-addr=:9999 ports: diff --git a/cmapisrv-mock/deploy/cmapisrv-mock/values.yaml b/cmapisrv-mock/deploy/cmapisrv-mock/values.yaml index 981d344c..45249356 100644 --- a/cmapisrv-mock/deploy/cmapisrv-mock/values.yaml +++ b/cmapisrv-mock/deploy/cmapisrv-mock/values.yaml @@ -56,6 +56,7 @@ config: # Global etcd rate limiting settings. etcdQPS: 1000 + etcdBootstrapQPS: 10000 etcdMaxInflight: 100 podAnnotations: {} diff --git a/cmapisrv-mock/internal/mocker/cells.go b/cmapisrv-mock/internal/mocker/cells.go index 356ce6f9..d02b4691 100644 --- a/cmapisrv-mock/internal/mocker/cells.go +++ b/cmapisrv-mock/internal/mocker/cells.go @@ -30,7 +30,11 @@ var Cell = cell.Module( kvstore.Cell(kvstore.EtcdBackendName), heartbeat.Cell, - cell.Provide(func() *kvstore.ExtraOptions { return nil }), + cell.Provide(func(ss syncstate.SyncState) *kvstore.ExtraOptions { + return &kvstore.ExtraOptions{ + BootstrapComplete: ss.WaitChannel(), + } + }), store.Cell, cmhealth.HealthAPIServerCell,