You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Moved index cache key struct outside of the file containing the in-memory cache backend because generic
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Added cacheKey.string() to make it memcached friendly
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Added MemcachedIndexCache support
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Export Prometheus metrics from MemcachedIndexCache
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Fixed linter issues
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Simplified workers wait group in memcachedClient
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Fixed memcached client GetMulti() results batches channel buffer
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Wait for addrs resolution gorouting to complete on memcachedClient.Stop()
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Return struct from NewMemcachedClient()
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Update pkg/cacheutil/memcached_client.go
Co-Authored-By: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Simplified memcachedClient tests
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Cleaned up code based on feedback
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Removed error from GetMulti() return and introduced metrics and tracing in MemcachedClient
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Fixed compilation errors in store E2E tests
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Added leaktest check to all tests
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Introduced --index.cache-config support
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Fixed compilation errors in store E2E tests
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Updated store flags doc
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Updated index cache doc
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Updated changelog
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Increased default memcached client timeout from 100ms to 500ms
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Disabled memcached client max batch size by default
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Fixed index cache key max length
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Removed TODO from memcached client since looks the general consensus is to have a global limit on the max concurrent batches
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Allow to configure in-memory index cache using byte units
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Refactored index cache config file doc
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Fixed nits in comments
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Replaced hardcoded 16 with ULID calculated length based on review comment
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Do not expose jumpHash func
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Updated changelog
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Switched MemcachedClient GetMulti() concurrency limit to a gate
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Fixed flaky tests
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Fixed typos in comments
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Renamed memcached config option addrs to addresses
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel
22
22
-[#1854](https://github.com/thanos-io/thanos/pull/1854) Update Rule UI to support alerts count displaying and filtering.
23
23
-[#1838](https://github.com/thanos-io/thanos/pull/1838) Ruler: Add TLS and authentication support for Alertmanager with the `--alertmanagers.config` and `--alertmanagers.config-file` CLI flags. See [documentation](docs/components/rule.md/#configuration) for further information.
24
24
-[#1838](https://github.com/thanos-io/thanos/pull/1838) Ruler: Add a new `--alertmanagers.sd-dns-interval` CLI option to specify the interval between DNS resolutions of Alertmanager hosts.
25
+
-[#1881](https://github.com/thanos-io/thanos/pull/1881) Store Gateway: memcached support for index cache. See [documentation](docs/components/store.md/#index-cache) for further information.
dataDir:=cmd.Flag("data-dir", "Data directory in which to cache remote blocks.").
37
37
Default("./data").String()
38
38
39
-
indexCacheSize:=cmd.Flag("index-cache-size", "Maximum size of items held in the index cache.").
39
+
indexCacheSize:=cmd.Flag("index-cache-size", "Maximum size of items held in the in-memory index cache. Ignored if --index-cache.config or --index-cache.config-file option is specified.").
--chunk-pool-size=2GB Maximum size of concurrently allocatable bytes
73
85
for chunks.
74
86
--store.grpc.series-sample-limit=0
@@ -151,3 +163,61 @@ Filtering is done on a Chunk level, so Thanos Store might still return Samples w
151
163
-`/-/ready` starts after all the bootstrapping completed (e.g initial index building) and ready to serve traffic.
152
164
153
165
> NOTE: Metric endpoint starts immediately so, make sure you set up readiness probe on designated HTTP `/-/ready` path.
166
+
167
+
## Index cache
168
+
169
+
Thanos Store Gateway supports an index cache to speed up postings and series lookups from TSDB blocks indexes. Two types of caches are supported:
170
+
171
+
-`in-memory` (_default_)
172
+
-`memcached`
173
+
174
+
### In-memory index cache
175
+
176
+
The `in-memory` index cache is enabled by default and its max size can be configured through the flag `--index-cache-size`.
177
+
178
+
Alternatively, the `in-memory` index cache can also by configured using `--index-cache.config-file` to reference to the configuration file or `--index-cache.config` to put yaml config directly:
- `max_size`: overall maximum number of bytes cache can contain. The value should be specified with a bytes unit (ie. `250MB`).
191
+
- `max_item_size`: maximum size of single item, in bytes. The value should be specified with a bytes unit (ie. `125MB`).
192
+
193
+
### Memcached index cache
194
+
195
+
The `memcached` index cache allows to use [Memcached](https://memcached.org) as cache backend. This cache type is configured using `--index-cache.config-file` to reference to the configuration file or `--index-cache.config` to put yaml config directly:
- `addresses`: list of memcached addresses, that will get resolved with the [DNS service discovery](../service-discovery.md/#dns-service-discovery) provider.
214
+
215
+
While the remaining settings are **optional**:
216
+
217
+
- `timeout`: the socket read/write timeout.
218
+
- `max_idle_connections`: maximum number of idle connections that will be maintained per address.
219
+
- `max_async_concurrency`: maximum number of concurrent asynchronous operations can occur.
220
+
- `max_async_buffer_size`: maximum number of enqueued asynchronous operations allowed.
221
+
- `max_get_multi_concurrency`: maximum number of concurrent connections when fetching keys. If set to `0`, the concurrency is unlimited.
222
+
- `max_get_multi_batch_size`: maximum number of keys a single underlying operation should fetch. If more keys are specified, internally keys are splitted into multiple batches and fetched concurrently, honoring `max_get_multi_concurrency`. If set to `0`, the batch size is unlimited.
223
+
- `dns_provider_update_interval`: the DNS discovery update interval.
0 commit comments