Skip to content

Commit 916acfc

Browse files
committed
update doc
Signed-off-by: Ben Ye <benye@amazon.com>
1 parent 097856b commit 916acfc

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* [FEATURE] Querier/Ruler: Support the new thanos promql engine. This is an experimental feature and might change in the future. #5093
2525
* [FEATURE] Added zstd as an option for grpc compression #5092
2626
* [FEATURE] Ring: Add new kv store option `dynamodb`. #5026
27+
* [FEATURE] Cache: Support redis as backend for caching bucket and index cache. #5057
2728
* [BUGFIX] Updated `golang.org/x/net` dependency to fix CVE-2022-27664. #5008
2829
* [BUGFIX] Fix panic when otel and xray tracing is enabled. #5044
2930
* [BUGFIX] Fixed no compact block got grouped in shuffle sharding grouper. #5055

docs/blocks-storage/store-gateway.template

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ The store-gateway can use a cache to speed up lookups of postings and series fro
117117

118118
- `inmemory`
119119
- `memcached`
120+
- `redis`
120121

121122
#### In-memory index cache
122123

@@ -139,20 +140,26 @@ The Memcached client uses a jump hash algorithm to shard cached entries across a
139140
For example, if you're running Memcached in Kubernetes, you may:
140141

141142
1. Deploy your Memcached cluster using a [StatefulSet](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/)
142-
2. Create an [headless service](https://kubernetes.io/docs/concepts/services-networking/service/#headless-services) for Memcached StatefulSet
143+
2. Create a [headless service](https://kubernetes.io/docs/concepts/services-networking/service/#headless-services) for Memcached StatefulSet
143144
3. Configure the Cortex's Memcached client address using the `dnssrvnoa+` [service discovery](../configuration/arguments.md#dns-service-discovery)
144145

146+
#### Redis index cache
147+
148+
The `redis` index cache allows to use [Redis](https://memcached.org/) as cache backend. This cache backend is configured using `-blocks-storage.bucket-store.index-cache.backend=redis` and requires the Redis server(s) addresses via `-blocks-storage.bucket-store.index-cache.redis.addresses` (or config file).
149+
150+
Using `redis` as the cache backend has similar trade-offs as using `memcached` cache backend. However, client side caching can be enabled when using `redis` backend to avoid Store Gateway fetching data from cache each time. See [here](https://redis.io/docs/manual/client-side-caching/) for more info and it can be enabled by setting flag `-blocks-storage.bucket-store.index-cache.redis.cache-size` > 0.
151+
145152
### Chunks cache
146153

147154
Store-gateway can also use a cache for storing chunks fetched from the storage. Chunks contain actual samples, and can be reused if user query hits the same series for the same time range.
148155

149-
To enable chunks cache, please set `-blocks-storage.bucket-store.chunks-cache.backend`. Chunks can currently only be stored into Memcached cache. Memcached client can be configured via flags with `-blocks-storage.bucket-store.chunks-cache.memcached.*` prefix.
156+
To enable chunks cache, please set `-blocks-storage.bucket-store.chunks-cache.backend`. Chunks can be stored into Memcached or Redis cache. Memcached client can be configured via flags with `-blocks-storage.bucket-store.chunks-cache.memcached.*` prefix. Redis client can be configured via flags with `-blocks-storage.bucket-store.chunks-cache.redis.*` prefix.
150157

151158
There are additional low-level options for configuring chunks cache. Please refer to other flags with `-blocks-storage.bucket-store.chunks-cache.*` prefix.
152159

153160
### Metadata cache
154161

155-
Store-gateway and [querier](./querier.md) can use memcached for caching bucket metadata:
162+
Store-gateway and [querier](./querier.md) can use memcached or redis for caching bucket metadata:
156163

157164
- List of tenants
158165
- List of blocks per tenant
@@ -162,11 +169,11 @@ Store-gateway and [querier](./querier.md) can use memcached for caching bucket m
162169

163170
Using the metadata cache can significantly reduce the number of API calls to object storage and protects from linearly scale the number of these API calls with the number of querier and store-gateway instances (because the bucket is periodically scanned and synched by each querier and store-gateway).
164171

165-
To enable metadata cache, please set `-blocks-storage.bucket-store.metadata-cache.backend`. Only `memcached` backend is supported currently. Memcached client has additional configuration available via flags with `-blocks-storage.bucket-store.metadata-cache.memcached.*` prefix.
172+
To enable metadata cache, please set `-blocks-storage.bucket-store.metadata-cache.backend`. `memcached` and `redis` backend are supported currently. Memcached client has additional configuration available via flags with `-blocks-storage.bucket-store.metadata-cache.memcached.*` prefix. Redis client has additional configuration available via flags with `-blocks-storage.bucket-store.metadata-cache.redis.*` prefix.
166173

167174
Additional options for configuring metadata cache have `-blocks-storage.bucket-store.metadata-cache.*` prefix. By configuring TTL to zero or negative value, caching of given item type is disabled.
168175

169-
_The same memcached backend cluster should be shared between store-gateways and queriers._
176+
_The same cache backend deployment should be shared between store-gateways and queriers._
170177

171178
## Store-gateway HTTP endpoints
172179

0 commit comments

Comments
 (0)