Skip to content

Commit 92d7684

Browse files
committed
tsdb: Use literal numbers instead of variables
Signed-off-by: Arve Knudsen <[email protected]>
1 parent e751ecc commit 92d7684

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

cortex/tsdb.libsonnet

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,21 @@
222222
'blocks-storage.bucket-store.index-header-lazy-loading-enabled': 'true',
223223
'blocks-storage.bucket-store.index-header-lazy-loading-idle-timeout': '60m',
224224

225-
local indexMaxConcurrency = 100,
226-
local chunksMaxConcurrency = 100,
227-
local metaMaxConcurrency = 100,
228225
'blocks-storage.bucket-store.max-chunk-pool-bytes': 12 * 1024 * 1024 * 1024,
229-
'blocks-storage.bucket-store.index-cache.memcached.max-get-multi-concurrency': indexMaxConcurrency,
230-
'blocks-storage.bucket-store.chunks-cache.memcached.max-get-multi-concurrency': chunksMaxConcurrency,
231-
'blocks-storage.bucket-store.metadata-cache.memcached.max-get-multi-concurrency': metaMaxConcurrency,
226+
227+
// We should keep a number of idle connections equal to the max "get" concurrency,
228+
// in order to avoid re-opening connections continuously (this would be slower
229+
// and fill up the conntrack table too).
230+
//
231+
// The downside of this approach is that we'll end up with an higher number of
232+
// active connections to memcached, so we have to make sure connections limit
233+
// set in memcached is high enough.
234+
'blocks-storage.bucket-store.index-cache.memcached.max-get-multi-concurrency': 100,
235+
'blocks-storage.bucket-store.chunks-cache.memcached.max-get-multi-concurrency': 100,
236+
'blocks-storage.bucket-store.metadata-cache.memcached.max-get-multi-concurrency': 100,
232237
'blocks-storage.bucket-store.index-cache.memcached.max-idle-connections': $.store_gateway_args['blocks-storage.bucket-store.index-cache.memcached.max-get-multi-concurrency'],
233238
'blocks-storage.bucket-store.chunks-cache.memcached.max-idle-connections': $.store_gateway_args['blocks-storage.bucket-store.chunks-cache.memcached.max-get-multi-concurrency'],
234239
'blocks-storage.bucket-store.metadata-cache.memcached.max-idle-connections': $.store_gateway_args['blocks-storage.bucket-store.metadata-cache.memcached.max-get-multi-concurrency'],
235-
236240
} +
237241
$.blocks_chunks_caching_config +
238242
$.blocks_metadata_caching_config +

0 commit comments

Comments
 (0)