thanos icon indicating copy to clipboard operation
thanos copied to clipboard

Query Frontend: cache sharding query analysis

Open yeya24 opened this issue 2 years ago • 1 comments

Is your proposal related to a problem?

Considering a lot of queries are executed in a regular basis (like alerting and recording rules evaluation), it might be unnecessary to analyze the same query everytime. We could introduce a LRU cache to cache the QueryAnalysis result or error.

Describe the solution you'd like

Use github.com/hashicorp/golang-lru as the LRU cache and add it to the QueryAnalyzer. Probably there are better LRU implementations but the idea should be similar.

yeya24 avatar Sep 23 '22 05:09 yeya24

Hello Ben, I would like to work on this issue.

Rahulkumar2002 avatar Sep 23 '22 06:09 Rahulkumar2002

Fixed in https://github.com/thanos-io/thanos/pull/5749. Thx @Rahulkumar2002 :muscle:

GiedriusS avatar Oct 21 '22 14:10 GiedriusS

Fixed in https://github.com/thanos-io/thanos/pull/5749. Thx @Rahulkumar2002 :muscle:

No problem 😊

Rahulkumar2002 avatar Oct 21 '22 14:10 Rahulkumar2002