Skip to content

Commit 41a44af

Browse files
authored
Merge pull request grafana#398 from grafana/remove-chunks-storage-query-sharding
Removed chunks storage query sharding config support
2 parents c030037 + 67d8399 commit 41a44af

File tree

4 files changed

+12
-50
lines changed

4 files changed

+12
-50
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
* [CHANGE] Changed default `job_names` for query-frontend, query-scheduler and querier to match custom deployments too. #376
2828
* [CHANGE] Increase the rules per group and rule groups limits on different tiers. #396
2929
* [CHANGE] Removed `max_samples_per_query` limit, since it only works with chunks and only when using `-distributor.shard-by-all-labels=false`. #397
30+
* [CHANGE] Removed chunks storage query sharding config support. The following config options have been removed: #398
31+
* `_config` > `queryFrontend` > `shard_factor`
32+
* `_config` > `queryFrontend` > `sharded_queries_enabled`
33+
* `_config` > `queryFrontend` > `query_split_factor`
3034
* [ENHANCEMENT] Add overrides config to compactor. This allows setting retention configs per user. #386
3135
* [ENHANCEMENT] cortex-mixin: Make `cluster_namespace_deployment:kube_pod_container_resource_requests_{cpu_cores,memory_bytes}:sum` backwards compatible with `kube-state-metrics` v2.0.0. #317
3236
* [ENHANCEMENT] Cortex-mixin: Include `cortex-gw-internal` naming variation in default `gateway` job names. #328

cortex/config.libsonnet

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,13 @@
3535
test_exporter_start_time: error 'must specify test exporter start time',
3636
test_exporter_user_id: error 'must specify test exporter used id',
3737

38-
// The expectation is that if sharding is enabled, we can force more (smaller)
39-
// queries on the queriers. However this can't be extended too far because most queries
40-
// concern recent (ingester) data, which isn't sharded. Therefore, we must strike a balance
41-
// which allows us to process more sharded queries in parallel when requested, but not overload
42-
// queriers during normal queries.
4338
querier: {
44-
replicas: if $._config.queryFrontend.sharded_queries_enabled then 12 else 6,
45-
concurrency: if $._config.queryFrontend.sharded_queries_enabled then 16 else 8,
39+
replicas: 6,
40+
concurrency: 8,
4641
},
4742

4843
queryFrontend: {
4944
replicas: 2,
50-
shard_factor: 16, // v10 schema shard factor
51-
sharded_queries_enabled: false,
52-
// Queries can technically be sharded an arbitrary number of times. Thus query_split_factor is used
53-
// as a coefficient to multiply the frontend tenant queues by. The idea is that this
54-
// yields a bit of headroom so tenant queues aren't underprovisioned. Therefore the split factor
55-
// should be represent the highest reasonable split factor for a query. If too low, a long query
56-
// (i.e. 30d) with a high split factor (i.e. 5) would result in
57-
// (day_splits * shard_factor * split_factor) or 30 * 16 * 5 = 2400 sharded queries, which may be
58-
// more than the max queue size and thus would always error.
59-
query_split_factor:: 3,
6045
},
6146

6247
jaeger_agent_host: null,

cortex/querier.libsonnet

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,8 @@
4747
$.jaeger_mixin +
4848
$.util.readinessProbe +
4949
container.withEnvMap($.querier_env_map) +
50-
if $._config.queryFrontend.sharded_queries_enabled then
51-
$.util.resourcesRequests('3', '12Gi') +
52-
$.util.resourcesLimits(null, '24Gi')
53-
else
54-
$.util.resourcesRequests('1', '12Gi') +
55-
$.util.resourcesLimits(null, '24Gi'),
50+
$.util.resourcesRequests('1', '12Gi') +
51+
$.util.resourcesLimits(null, '24Gi'),
5652

5753
local deployment = $.apps.v1.deployment,
5854

cortex/query-frontend.libsonnet

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,46 +36,23 @@
3636
// Limit queries to 500 days, allow this to be override per-user.
3737
'store.max-query-length': '12000h', // 500 Days
3838
'runtime-config.file': '/etc/cortex/overrides.yaml',
39-
} + (
40-
if $._config.queryFrontend.sharded_queries_enabled then
41-
{
42-
'querier.parallelise-shardable-queries': 'true',
43-
44-
// in process tenant queues on frontends. We divide by the number of frontends; 2 in this case in order to apply the global limit in aggregate.
45-
// basically base * shard_factor * query_split_factor / num_frontends where
46-
'querier.max-outstanding-requests-per-tenant': std.floor(200 * $._config.queryFrontend.shard_factor * $._config.queryFrontend.query_split_factor / $._config.queryFrontend.replicas),
47-
48-
'querier.query-ingesters-within': $._config.queryConfig['querier.query-ingesters-within'],
49-
} + $._config.storageConfig
50-
else {}
51-
),
39+
},
5240

5341
query_frontend_container::
5442
container.new('query-frontend', $._images.query_frontend) +
5543
container.withPorts($.util.defaultPorts) +
5644
container.withArgsMixin($.util.mapToFlags($.query_frontend_args)) +
5745
$.jaeger_mixin +
5846
$.util.readinessProbe +
59-
if $._config.queryFrontend.sharded_queries_enabled then
60-
$.util.resourcesRequests('2', '2Gi') +
61-
$.util.resourcesLimits(null, '6Gi') +
62-
container.withEnvMap({
63-
JAEGER_REPORTER_MAX_QUEUE_SIZE: '5000',
64-
})
65-
else
66-
$.util.resourcesRequests('2', '600Mi') +
67-
$.util.resourcesLimits(null, '1200Mi'),
47+
$.util.resourcesRequests('2', '600Mi') +
48+
$.util.resourcesLimits(null, '1200Mi'),
6849

6950
local deployment = $.apps.v1.deployment,
7051

7152
newQueryFrontendDeployment(name, container)::
7253
deployment.new(name, $._config.queryFrontend.replicas, [container]) +
7354
$.util.configVolumeMount($._config.overrides_configmap, '/etc/cortex') +
74-
$.util.antiAffinity +
75-
// inject storage schema in order to know what/how to shard
76-
if $._config.queryFrontend.sharded_queries_enabled then
77-
$.storage_config_mixin
78-
else {},
55+
$.util.antiAffinity,
7956

8057
query_frontend_deployment: self.newQueryFrontendDeployment('query-frontend', $.query_frontend_container),
8158

0 commit comments

Comments
 (0)