mimir
mimir copied to clipboard
Make query-frontend cache TTL configurable, and increase the default.
Is your feature request related to a problem? Please describe.
query-frontend
caches results, but it sets a TTL of 7d to those results:
https://github.com/grafana/mimir/blob/cac269d4837e168b3b3f17b7e2e56cdacd79c4c7/pkg/frontend/querymiddleware/split_and_cache.go#L37-L38
If you're caching a year-long query, it means that you'll have to recalculate it next week again, which is undesirable.
Describe the solution you'd like
Make the TTL configurlable, allow no TTL at all (Memcache is LRU, why caring about TTL?)
Note that the maximum TTL for Memcache appears to be 30d.
Make the TTL configurlable, allow no TTL at all (Memcache is LRU, why caring about TTL?)
Please double check memcached evicts items with no TTL too.
Hello, I would like to work on this issue. Is there anything I should know before starting (Besides the contributing guidelines)? Thank you
Please double check memcached evicts items with no TTL too.
I would love someone to investigate ☝️ this, cause we should set no TTL at all if there's no downside.
From what I read in the documentation, non expired items (an expiration time of 0 or some time in the future), are evicted when there's no memory available to allocate new insertions. An expiration time of 0 means that no automatic expiration is done.
With that, I am not seeing any downside in not having a TTL at all as all evictions are treated equally.
From what I read in the documentation, non expired items (an expiration time of 0 or some time in the future), are evicted when there's no memory available to allocate new insertions. An expiration time of 0 means that no automatic expiration is done.
It's also possible to configure Redis like this so the default would be portable if/when Redis support is added.