Skip to content

Commit bbf01e8

Browse files
authored
Change -frontend.max-queriers-per-user to -frontend.max-queriers-per-tenant (#3257)
* Change -frontend.max-queriers-per-user to -frontend.max-queriers-per-tenant. Signed-off-by: Peter Štibraný <[email protected]> * CHANGELOG.md Signed-off-by: Peter Štibraný <[email protected]>
1 parent 56aa40c commit bbf01e8

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
- `POST <legacy-http-prefix>/push`
4141
- `POST /push`
4242
- `POST /ingester/push`
43-
* [FEATURE] Added support for shuffle-sharding queriers in the query-frontend. When configured (`-frontend.max-queriers-per-user` globally, or using per-user limit `max_queriers_per_user`), each user's requests will be handled by different set of queriers. #3113
43+
* [FEATURE] Added support for shuffle-sharding queriers in the query-frontend. When configured (`-frontend.max-queriers-per-tenant` globally, or using per-tenant limit `max_queriers_per_tenant`), each tenants's requests will be handled by different set of queriers. #3113 #3257
4444
* [FEATURE] Query-frontend: added `compression` config to support results cache with compression. #3217
4545
* [ENHANCEMENT] Expose additional HTTP configs for the S3 backend client. New flag are listed below: #3244
4646
- `-blocks-storage.s3.http.idle-conn-timeout`

docs/configuration/config-file-reference.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2852,14 +2852,14 @@ The `limits_config` configures default and per-tenant limits imposed by Cortex s
28522852
# CLI flag: -frontend.max-cache-freshness
28532853
[max_cache_freshness: <duration> | default = 1m]
28542854
2855-
# Maximum number of queriers that can handle requests for a single user. If set
2856-
# to 0 or value higher than number of available queriers, *all* queriers will
2857-
# handle requests for the user. Each frontend will select the same set of
2858-
# queriers for the same user (given that all queriers are connected to all
2855+
# Maximum number of queriers that can handle requests for a single tenant. If
2856+
# set to 0 or value higher than number of available queriers, *all* queriers
2857+
# will handle requests for the tenant. Each frontend will select the same set of
2858+
# queriers for the same tenant (given that all queriers are connected to all
28592859
# frontends). This option only works with queriers connecting to the
28602860
# query-frontend, not when using downstream URL.
2861-
# CLI flag: -frontend.max-queriers-per-user
2862-
[max_queriers_per_user: <int> | default = 0]
2861+
# CLI flag: -frontend.max-queriers-per-tenant
2862+
[max_queriers_per_tenant: <int> | default = 0]
28632863
28642864
# Duration to delay the evaluation of rules to ensure the underlying metrics
28652865
# have been pushed to Cortex.

docs/configuration/v1-guarantees.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Currently experimental features are:
4747
- gRPC Store.
4848
- Querier support for querying chunks and blocks store at the same time.
4949
- Tracking of active series and exporting them as metrics (`-ingester.active-series-metrics-enabled` and related flags)
50-
- Shuffle-sharding of queriers in the query-frontend (i.e. use of `-frontend.max-queriers-per-user` flag with non-zero value).
50+
- Shuffle-sharding of queriers in the query-frontend (i.e. use of `-frontend.max-queriers-per-tenant` flag with non-zero value).
5151
- TLS configuration in gRPC and HTTP clients.
5252
- TLS configuration in Etcd client.
5353
- Blocksconvert tools

docs/guides/shuffle-sharding.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ _The shard size can be overridden on a per-tenant basis in the limits overrides
7979

8080
By default all Cortex queriers can execute received queries for given tenant.
8181

82-
When shuffle sharding is **enabled** by setting `-frontend.max-queriers-per-user` (or its respective YAML config option) to a value higher than 0 and lower than the number of available queriers, only specified number of queriers will execute queries for single tenant. Note that this distribution happens in query-frontend. When not using query-frontend, this option is not available.
82+
When shuffle sharding is **enabled** by setting `-frontend.max-queriers-per-tenant` (or its respective YAML config option) to a value higher than 0 and lower than the number of available queriers, only specified number of queriers will execute queries for single tenant. Note that this distribution happens in query-frontend. When not using query-frontend, this option is not available.
8383

8484
_The maximum number of queriers can be overridden on a per-tenant basis in the limits overrides configuration._
8585

integration/querier_sharding_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func runQuerierShardingTest(t *testing.T, sharding bool) {
5454

5555
if sharding {
5656
// Use only single querier for each user.
57-
flags["-frontend.max-queriers-per-user"] = "1"
57+
flags["-frontend.max-queriers-per-tenant"] = "1"
5858
}
5959

6060
// Start Cortex components.

pkg/util/validation/limits.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ type Limits struct {
6363
MaxGlobalMetadataPerMetric int `yaml:"max_global_metadata_per_metric"`
6464

6565
// Querier enforced limits.
66-
MaxChunksPerQuery int `yaml:"max_chunks_per_query"`
67-
MaxQueryLength time.Duration `yaml:"max_query_length"`
68-
MaxQueryParallelism int `yaml:"max_query_parallelism"`
69-
CardinalityLimit int `yaml:"cardinality_limit"`
70-
MaxCacheFreshness time.Duration `yaml:"max_cache_freshness"`
71-
MaxQueriersPerUser int `yaml:"max_queriers_per_user"`
66+
MaxChunksPerQuery int `yaml:"max_chunks_per_query"`
67+
MaxQueryLength time.Duration `yaml:"max_query_length"`
68+
MaxQueryParallelism int `yaml:"max_query_parallelism"`
69+
CardinalityLimit int `yaml:"cardinality_limit"`
70+
MaxCacheFreshness time.Duration `yaml:"max_cache_freshness"`
71+
MaxQueriersPerTenant int `yaml:"max_queriers_per_tenant"`
7272

7373
// Ruler defaults and limits.
7474
RulerEvaluationDelay time.Duration `yaml:"ruler_evaluation_delay_duration"`
@@ -119,7 +119,7 @@ func (l *Limits) RegisterFlags(f *flag.FlagSet) {
119119
f.IntVar(&l.MaxQueryParallelism, "querier.max-query-parallelism", 14, "Maximum number of queries will be scheduled in parallel by the frontend.")
120120
f.IntVar(&l.CardinalityLimit, "store.cardinality-limit", 1e5, "Cardinality limit for index queries. This limit is ignored when running the Cortex blocks storage. 0 to disable.")
121121
f.DurationVar(&l.MaxCacheFreshness, "frontend.max-cache-freshness", 1*time.Minute, "Most recent allowed cacheable result per-tenant, to prevent caching very recent results that might still be in flux.")
122-
f.IntVar(&l.MaxQueriersPerUser, "frontend.max-queriers-per-user", 0, "Maximum number of queriers that can handle requests for a single user. If set to 0 or value higher than number of available queriers, *all* queriers will handle requests for the user. Each frontend will select the same set of queriers for the same user (given that all queriers are connected to all frontends). This option only works with queriers connecting to the query-frontend, not when using downstream URL.")
122+
f.IntVar(&l.MaxQueriersPerTenant, "frontend.max-queriers-per-tenant", 0, "Maximum number of queriers that can handle requests for a single tenant. If set to 0 or value higher than number of available queriers, *all* queriers will handle requests for the tenant. Each frontend will select the same set of queriers for the same tenant (given that all queriers are connected to all frontends). This option only works with queriers connecting to the query-frontend, not when using downstream URL.")
123123

124124
f.DurationVar(&l.RulerEvaluationDelay, "ruler.evaluation-delay-duration", 0, "Duration to delay the evaluation of rules to ensure the underlying metrics have been pushed to Cortex.")
125125

@@ -311,7 +311,7 @@ func (o *Overrides) MaxCacheFreshness(userID string) time.Duration {
311311

312312
// MaxQueriersPerUser returns the maximum number of queriers that can handle requests for this user.
313313
func (o *Overrides) MaxQueriersPerUser(userID string) int {
314-
return o.getOverridesForUser(userID).MaxQueriersPerUser
314+
return o.getOverridesForUser(userID).MaxQueriersPerTenant
315315
}
316316

317317
// MaxQueryParallelism returns the limit to the number of sub-queries the

0 commit comments

Comments
 (0)