Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make max outstanding queries per tenant config in limits #4991

Merged
merged 2 commits into from
Dec 1, 2022

Conversation

yeya24
Copy link
Collaborator

@yeya24 yeya24 commented Nov 23, 2022

Signed-off-by: Ben Ye benye@amazon.com

What this PR does:

Now the QFE queue size is a global configuration https://github.com/cortexproject/cortex/blob/master/pkg/frontend/v1/frontend.go#L40, which means we cannot override the queue size for different tenants.

For different tenants, we may want to use different queue sizes based on their query concurrency. Making it a per-tenant config in limits makes it more flexible and easier to update during runtime.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@yeya24
Copy link
Collaborator Author

yeya24 commented Nov 23, 2022

And since the query vertical sharding size is also per tenant, the queue size needs to be adjusted per tenant if we enable sharding for some tenants only.

@yeya24 yeya24 requested a review from alanprot November 28, 2022 18:08
@@ -2724,6 +2726,11 @@ The `limits_config` configures default and per-tenant limits imposed by Cortex s
# CLI flag: -frontend.max-queriers-per-tenant
[max_queriers_per_tenant: <int> | default = 0]

# Maximum number of outstanding requests per tenant per request queue (either
# query frontend or query scheduler); requests beyond this error with HTTP 429.
# CLI flag: -frontend.max-outstanding-requests-per-tenant
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah.. i think make sense this limit be related to frontend if we use or not the scheduler.

@@ -37,13 +37,25 @@ type Config struct {

// RegisterFlags adds the flags required to config this to the given FlagSet.
func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
f.IntVar(&cfg.MaxOutstandingPerTenant, "querier.max-outstanding-requests-per-tenant", 100, "Maximum number of outstanding requests per tenant per frontend; requests beyond this error with HTTP 429.")
f.IntVar(&cfg.MaxOutstandingPerTenant, "querier.max-outstanding-requests-per-tenant", 0, "Deprecated (user frontend.max-outstanding-requests-per-tenant instead): Maximum number of outstanding requests per tenant per frontend; requests beyond this error with HTTP 429.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to start documenting when the deprecated flags will be removed (on which version)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. PTAL

Signed-off-by: Ben Ye <benye@amazon.com>
@yeya24 yeya24 force-pushed the queue-size-per-tenant branch 2 times, most recently from 9fa309b to 6f6cfbb Compare November 29, 2022 04:14
Signed-off-by: Ben Ye <benye@amazon.com>
@alanprot
Copy link
Member

alanprot commented Dec 1, 2022

Thanks! LGTM

@alanprot alanprot merged commit 51ad6df into cortexproject:master Dec 1, 2022
@yeya24 yeya24 deleted the queue-size-per-tenant branch December 1, 2022 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants