Skip to content

Commit e551a2e

Browse files
authored
Unify chunks and metadata cache backend to bucket cache (#6829)
* unify chunks and metadata cache to bucket cache Signed-off-by: yeya24 <[email protected]> * update docs Signed-off-by: Ben Ye <[email protected]> * update changelog Signed-off-by: Ben Ye <[email protected]> --------- Signed-off-by: yeya24 <[email protected]> Signed-off-by: Ben Ye <[email protected]>
1 parent bf88f67 commit e551a2e

10 files changed

+196
-154
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
* [ENHANCEMENT] Compactor: Optimize cleaner run time. #6815
4747
* [ENHANCEMENT] Parquet Storage: Allow percentage based dynamic shard size for Parquet Converter. #6817
4848
* [ENHANCEMENT] Query Frontend: Enhance the performance of the JSON codec. #6816
49+
* [ENHANCEMENT] Metadata Cache: Support inmemory and multi level cache backend. #6829
4950
* [ENHANCEMENT] Store Gateway: Allow to ignore syncing blocks older than certain time using `ignore_blocks_before`. #6830
5051
* [BUGFIX] Ingester: Avoid error or early throttling when READONLY ingesters are present in the ring #6517
5152
* [BUGFIX] Ingester: Fix labelset data race condition. #6573

docs/blocks-storage/querier.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,8 @@ blocks_storage:
854854
[backend: <string> | default = ""]
855855

856856
inmemory:
857-
# Maximum size in bytes of in-memory chunk cache used to speed up chunk
858-
# lookups (shared between all tenants).
857+
# Maximum size in bytes of in-memory chunks cache used (shared between
858+
# all tenants).
859859
# CLI flag: -blocks-storage.bucket-store.chunks-cache.inmemory.max-size-bytes
860860
[max_size_bytes: <int> | default = 1073741824]
861861

@@ -1095,11 +1095,19 @@ blocks_storage:
10951095
[subrange_ttl: <duration> | default = 24h]
10961096

10971097
metadata_cache:
1098-
# Backend for metadata cache, if not empty. Supported values: memcached,
1099-
# redis, and '' (disable).
1098+
# The metadata cache backend type. Single or Multiple cache backend can be
1099+
# provided. Supported values in single cache: memcached, redis, inmemory,
1100+
# and '' (disable). Supported values in multi level cache: a
1101+
# comma-separated list of (inmemory, memcached, redis)
11001102
# CLI flag: -blocks-storage.bucket-store.metadata-cache.backend
11011103
[backend: <string> | default = ""]
11021104

1105+
inmemory:
1106+
# Maximum size in bytes of in-memory metadata cache used (shared between
1107+
# all tenants).
1108+
# CLI flag: -blocks-storage.bucket-store.metadata-cache.inmemory.max-size-bytes
1109+
[max_size_bytes: <int> | default = 1073741824]
1110+
11031111
memcached:
11041112
# Comma separated list of memcached addresses. Supported prefixes are:
11051113
# dns+ (looked up as an A/AAAA query), dnssrv+ (looked up as a SRV
@@ -1301,6 +1309,21 @@ blocks_storage:
13011309
# CLI flag: -blocks-storage.bucket-store.metadata-cache.redis.set-async.circuit-breaker.failure-percent
13021310
[failure_percent: <float> | default = 0.05]
13031311

1312+
multilevel:
1313+
# The maximum number of concurrent asynchronous operations can occur
1314+
# when backfilling cache items.
1315+
# CLI flag: -blocks-storage.bucket-store.metadata-cache.multilevel.max-async-concurrency
1316+
[max_async_concurrency: <int> | default = 3]
1317+
1318+
# The maximum number of enqueued asynchronous operations allowed when
1319+
# backfilling cache items.
1320+
# CLI flag: -blocks-storage.bucket-store.metadata-cache.multilevel.max-async-buffer-size
1321+
[max_async_buffer_size: <int> | default = 10000]
1322+
1323+
# The maximum number of items to backfill per asynchronous operation.
1324+
# CLI flag: -blocks-storage.bucket-store.metadata-cache.multilevel.max-backfill-items
1325+
[max_backfill_items: <int> | default = 10000]
1326+
13041327
# How long to cache list of tenants in the bucket.
13051328
# CLI flag: -blocks-storage.bucket-store.metadata-cache.tenants-list-ttl
13061329
[tenants_list_ttl: <duration> | default = 15m]

docs/blocks-storage/store-gateway.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -975,8 +975,8 @@ blocks_storage:
975975
[backend: <string> | default = ""]
976976

977977
inmemory:
978-
# Maximum size in bytes of in-memory chunk cache used to speed up chunk
979-
# lookups (shared between all tenants).
978+
# Maximum size in bytes of in-memory chunks cache used (shared between
979+
# all tenants).
980980
# CLI flag: -blocks-storage.bucket-store.chunks-cache.inmemory.max-size-bytes
981981
[max_size_bytes: <int> | default = 1073741824]
982982

@@ -1216,11 +1216,19 @@ blocks_storage:
12161216
[subrange_ttl: <duration> | default = 24h]
12171217

12181218
metadata_cache:
1219-
# Backend for metadata cache, if not empty. Supported values: memcached,
1220-
# redis, and '' (disable).
1219+
# The metadata cache backend type. Single or Multiple cache backend can be
1220+
# provided. Supported values in single cache: memcached, redis, inmemory,
1221+
# and '' (disable). Supported values in multi level cache: a
1222+
# comma-separated list of (inmemory, memcached, redis)
12211223
# CLI flag: -blocks-storage.bucket-store.metadata-cache.backend
12221224
[backend: <string> | default = ""]
12231225

1226+
inmemory:
1227+
# Maximum size in bytes of in-memory metadata cache used (shared between
1228+
# all tenants).
1229+
# CLI flag: -blocks-storage.bucket-store.metadata-cache.inmemory.max-size-bytes
1230+
[max_size_bytes: <int> | default = 1073741824]
1231+
12241232
memcached:
12251233
# Comma separated list of memcached addresses. Supported prefixes are:
12261234
# dns+ (looked up as an A/AAAA query), dnssrv+ (looked up as a SRV
@@ -1422,6 +1430,21 @@ blocks_storage:
14221430
# CLI flag: -blocks-storage.bucket-store.metadata-cache.redis.set-async.circuit-breaker.failure-percent
14231431
[failure_percent: <float> | default = 0.05]
14241432

1433+
multilevel:
1434+
# The maximum number of concurrent asynchronous operations can occur
1435+
# when backfilling cache items.
1436+
# CLI flag: -blocks-storage.bucket-store.metadata-cache.multilevel.max-async-concurrency
1437+
[max_async_concurrency: <int> | default = 3]
1438+
1439+
# The maximum number of enqueued asynchronous operations allowed when
1440+
# backfilling cache items.
1441+
# CLI flag: -blocks-storage.bucket-store.metadata-cache.multilevel.max-async-buffer-size
1442+
[max_async_buffer_size: <int> | default = 10000]
1443+
1444+
# The maximum number of items to backfill per asynchronous operation.
1445+
# CLI flag: -blocks-storage.bucket-store.metadata-cache.multilevel.max-backfill-items
1446+
[max_backfill_items: <int> | default = 10000]
1447+
14251448
# How long to cache list of tenants in the bucket.
14261449
# CLI flag: -blocks-storage.bucket-store.metadata-cache.tenants-list-ttl
14271450
[tenants_list_ttl: <duration> | default = 15m]

docs/configuration/config-file-reference.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,8 +1450,8 @@ bucket_store:
14501450
[backend: <string> | default = ""]
14511451

14521452
inmemory:
1453-
# Maximum size in bytes of in-memory chunk cache used to speed up chunk
1454-
# lookups (shared between all tenants).
1453+
# Maximum size in bytes of in-memory chunks cache used (shared between all
1454+
# tenants).
14551455
# CLI flag: -blocks-storage.bucket-store.chunks-cache.inmemory.max-size-bytes
14561456
[max_size_bytes: <int> | default = 1073741824]
14571457

@@ -1688,11 +1688,19 @@ bucket_store:
16881688
[subrange_ttl: <duration> | default = 24h]
16891689

16901690
metadata_cache:
1691-
# Backend for metadata cache, if not empty. Supported values: memcached,
1692-
# redis, and '' (disable).
1691+
# The metadata cache backend type. Single or Multiple cache backend can be
1692+
# provided. Supported values in single cache: memcached, redis, inmemory,
1693+
# and '' (disable). Supported values in multi level cache: a comma-separated
1694+
# list of (inmemory, memcached, redis)
16931695
# CLI flag: -blocks-storage.bucket-store.metadata-cache.backend
16941696
[backend: <string> | default = ""]
16951697

1698+
inmemory:
1699+
# Maximum size in bytes of in-memory metadata cache used (shared between
1700+
# all tenants).
1701+
# CLI flag: -blocks-storage.bucket-store.metadata-cache.inmemory.max-size-bytes
1702+
[max_size_bytes: <int> | default = 1073741824]
1703+
16961704
memcached:
16971705
# Comma separated list of memcached addresses. Supported prefixes are:
16981706
# dns+ (looked up as an A/AAAA query), dnssrv+ (looked up as a SRV query,
@@ -1892,6 +1900,21 @@ bucket_store:
18921900
# CLI flag: -blocks-storage.bucket-store.metadata-cache.redis.set-async.circuit-breaker.failure-percent
18931901
[failure_percent: <float> | default = 0.05]
18941902

1903+
multilevel:
1904+
# The maximum number of concurrent asynchronous operations can occur when
1905+
# backfilling cache items.
1906+
# CLI flag: -blocks-storage.bucket-store.metadata-cache.multilevel.max-async-concurrency
1907+
[max_async_concurrency: <int> | default = 3]
1908+
1909+
# The maximum number of enqueued asynchronous operations allowed when
1910+
# backfilling cache items.
1911+
# CLI flag: -blocks-storage.bucket-store.metadata-cache.multilevel.max-async-buffer-size
1912+
[max_async_buffer_size: <int> | default = 10000]
1913+
1914+
# The maximum number of items to backfill per asynchronous operation.
1915+
# CLI flag: -blocks-storage.bucket-store.metadata-cache.multilevel.max-backfill-items
1916+
[max_backfill_items: <int> | default = 10000]
1917+
18951918
# How long to cache list of tenants in the bucket.
18961919
# CLI flag: -blocks-storage.bucket-store.metadata-cache.tenants-list-ttl
18971920
[tenants_list_ttl: <duration> | default = 15m]

0 commit comments

Comments
 (0)