Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuang-Minh Nguyen <qmnguyen@gitlab.com>2023-09-27 05:06:08 +0300
committerQuang-Minh Nguyen <qmnguyen@gitlab.com>2023-10-04 08:06:04 +0300
commitdee9cee076950261d9eebd054d3abfdd7e0ded1d (patch)
treed903f6f255960f98b4b8fd2cba9dc0116fec64c2 /internal/cli/gitaly
parent27b44739c0cc64c24f04697777d1d857d98dd6ae (diff)
limiter: Integrate adaptive limit to per-rpc limiter
This commit adds new adaptive configs to the `concurrency` settings, including `Adaptive`, `MinLimit`, `MaxLimit`, and `InitialLimit`. Since we configure distinct limits for each individual RPC, each limit will float separately. That said, they will share the same calculator and be adjusted at the same time during calibration event. As the limiters are configured at boot time, we cannot use a feature flag. Instead, we add the new settings to targeted nodes. We can always rollback to the use of static limits by disabling `gitaly_use_resizable_semaphore_in_concurrency_limiter` feature flag.
Diffstat (limited to 'internal/cli/gitaly')
-rw-r--r--internal/cli/gitaly/serve.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/cli/gitaly/serve.go b/internal/cli/gitaly/serve.go
index 2a57189d8..165bc0eaa 100644
--- a/internal/cli/gitaly/serve.go
+++ b/internal/cli/gitaly/serve.go
@@ -296,9 +296,16 @@ func run(cfg config.Cfg, logger log.Logger) error {
return fmt.Errorf("disk cache walkers: %w", err)
}
+ // List of tracking adaptive limits. They will be calibrated by the adaptive calculator
adaptiveLimits := []limiter.AdaptiveLimiter{}
- _, setupPerRPCConcurrencyLimiters := limithandler.WithConcurrencyLimiters(cfg)
+ perRPCLimits, setupPerRPCConcurrencyLimiters := limithandler.WithConcurrencyLimiters(cfg)
+ for _, concurrency := range cfg.Concurrency {
+ // Connect adaptive limits to the adaptive calculator
+ if concurrency.Adaptive {
+ adaptiveLimits = append(adaptiveLimits, perRPCLimits[concurrency.RPC])
+ }
+ }
perRPCLimitHandler := limithandler.New(
cfg,
limithandler.LimitConcurrencyByRepo,