Skip to content

Commit 08645ca

Browse files
authored
Memcached configuration belongs in tsdb-config.libsonnet (#12)
This effectively fixes max idle connections for memcached-metadata in ruler and querier
1 parent c2eef2d commit 08645ca

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* [ENHANCEMENT] How to rename buckets in AWS and Azure for `not healthy index found` playbook. #5
1111
* [ENHANCEMENT] Support new metrics cortex_cache_fetched_keys_total and cortex_cache_fetched_keys_total
1212
* [BUGFIX] Updated blocks_storage_s3_endpoint in config.libsonnet to include the correct aws region
13+
* [BUGFIX] Fixes `-blocks-storage.bucket-store.metadata-cache.memcached.max-idle-connections` for ruler and querier
1314

1415
## 1.11.0 / 2021-12-30
1516

cortex/store-gateway.libsonnet

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,7 @@
2828
// Block index-headers are pre-downloaded but lazy mmaped and loaded at query time.
2929
'blocks-storage.bucket-store.index-header-lazy-loading-enabled': 'true',
3030
'blocks-storage.bucket-store.index-header-lazy-loading-idle-timeout': '60m',
31-
3231
'blocks-storage.bucket-store.max-chunk-pool-bytes': 12 * 1024 * 1024 * 1024,
33-
34-
// We should keep a number of idle connections equal to the max "get" concurrency,
35-
// in order to avoid re-opening connections continuously (this would be slower
36-
// and fill up the conntrack table too).
37-
//
38-
// The downside of this approach is that we'll end up with an higher number of
39-
// active connections to memcached, so we have to make sure connections limit
40-
// set in memcached is high enough.
41-
'blocks-storage.bucket-store.index-cache.memcached.max-get-multi-concurrency': 100,
42-
'blocks-storage.bucket-store.chunks-cache.memcached.max-get-multi-concurrency': 100,
43-
'blocks-storage.bucket-store.metadata-cache.memcached.max-get-multi-concurrency': 100,
44-
'blocks-storage.bucket-store.index-cache.memcached.max-idle-connections': $.store_gateway_args['blocks-storage.bucket-store.index-cache.memcached.max-get-multi-concurrency'],
45-
'blocks-storage.bucket-store.chunks-cache.memcached.max-idle-connections': $.store_gateway_args['blocks-storage.bucket-store.chunks-cache.memcached.max-get-multi-concurrency'],
46-
'blocks-storage.bucket-store.metadata-cache.memcached.max-idle-connections': $.store_gateway_args['blocks-storage.bucket-store.metadata-cache.memcached.max-get-multi-concurrency'],
4732
} +
4833
$.blocks_chunks_caching_config +
4934
$.blocks_metadata_caching_config +

cortex/tsdb-config.libsonnet

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
cortex_bucket_index_enabled: false,
2727
},
2828

29+
// We should keep a number of idle connections equal to the max "get" concurrency,
30+
// in order to avoid re-opening connections continuously (this would be slower
31+
// and fill up the conntrack table too).
32+
//
33+
// The downside of this approach is that we'll end up with an higher number of
34+
// active connections to memcached, so we have to make sure connections limit
35+
// set in memcached is high enough.
36+
2937
blocks_chunks_caching_config::
3038
(
3139
if $._config.memcached_index_queries_enabled then {
@@ -36,6 +44,8 @@
3644
'blocks-storage.bucket-store.index-cache.memcached.max-async-buffer-size': '25000',
3745
'blocks-storage.bucket-store.index-cache.memcached.max-async-concurrency': '50',
3846
'blocks-storage.bucket-store.index-cache.memcached.max-get-multi-batch-size': '100',
47+
'blocks-storage.bucket-store.index-cache.memcached.max-get-multi-concurrency': 100,
48+
'blocks-storage.bucket-store.index-cache.memcached.max-idle-connections': self['blocks-storage.bucket-store.index-cache.memcached.max-get-multi-concurrency'],
3949
} else {}
4050
) + (
4151
if $._config.memcached_chunks_enabled then {
@@ -46,6 +56,8 @@
4656
'blocks-storage.bucket-store.chunks-cache.memcached.max-async-buffer-size': '25000',
4757
'blocks-storage.bucket-store.chunks-cache.memcached.max-async-concurrency': '50',
4858
'blocks-storage.bucket-store.chunks-cache.memcached.max-get-multi-batch-size': '100',
59+
'blocks-storage.bucket-store.chunks-cache.memcached.max-get-multi-concurrency': 100,
60+
'blocks-storage.bucket-store.chunks-cache.memcached.max-idle-connections': self['blocks-storage.bucket-store.chunks-cache.memcached.max-get-multi-concurrency'],
4961
} else {}
5062
),
5163

@@ -57,6 +69,8 @@
5769
'blocks-storage.bucket-store.metadata-cache.memcached.max-async-buffer-size': '25000',
5870
'blocks-storage.bucket-store.metadata-cache.memcached.max-async-concurrency': '50',
5971
'blocks-storage.bucket-store.metadata-cache.memcached.max-get-multi-batch-size': '100',
72+
'blocks-storage.bucket-store.metadata-cache.memcached.max-get-multi-concurrency': 100,
73+
'blocks-storage.bucket-store.metadata-cache.memcached.max-idle-connections': self['blocks-storage.bucket-store.metadata-cache.memcached.max-get-multi-concurrency'],
6074
} else {},
6175

6276
bucket_index_config:: if $._config.cortex_bucket_index_enabled then {

0 commit comments

Comments
 (0)