Add fairness to history RPS rate limiter#10134
Open
prathyushpv wants to merge 3 commits intomainfrom
Open
Conversation
| return preemptablePriority | ||
| } | ||
| callerTypePri := configs.RequestToPriority(req) | ||
| if !enabled() { |
Contributor
There was a problem hiding this comment.
can this check be moved above checking Operator/Preemptable priority?
| ownershipBasedQuotaScaler, | ||
| nil, | ||
| func(string) int { return 0 }, | ||
| config.FrontendGlobalNamespaceRPS, |
Contributor
There was a problem hiding this comment.
should this be HistoryGlobalNamespaceRPS ? I assume it's mostly fine to share dynamic configs, considering frontend is more lightweight, but should we document that this config is used for History RPS rate limiting as well?
| } | ||
| metrics.ServiceRequestsNamespaceFairnessDemoted.With(metricsHandler).Record( | ||
| 1, | ||
| metrics.NamespaceTag(req.Caller), |
Contributor
There was a problem hiding this comment.
should we include the demoted priority value as well as a tag?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Add fairness mechanism to history rps rate limiter. Each namespace will have a history RPS limit quota per history host based on this formula
NamespaceQuota = FrontendRPSLimit * HistoryShardsInHost/TotalShards * Multiplier.
This multiplier is configurable through dynamic config. If a namespace's request rate exceeds this quota, those extra requests will be deprioritized. If history rps rate limiter starts to thorttle requests, these deprioritized requests will be throttled first. This will prevent unbalance load from a namespace affecting other namespaces in a history host.
Why?
To prevent noisy neighbour issues in history rps rate limiter.
How did you test it?