mimir icon indicating copy to clipboard operation
mimir copied to clipboard

Add caching to /config/v1/rules endpoint

Open aknuds1 opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe.

The /config/v1/rules endpoint, which loads all of a user's rule groups (potentially filtered by namespace), can be slow if the user has a lot of rule groups/rules.

Describe the solution you'd like

Discussing the above problem with @pstibrany, I was made aware that it's already been thought of to speed up rule group loading through caching. I suggest we go ahead and implement this, in order to be able to reduce latency.

Describe alternatives you've considered

Additional context

aknuds1 avatar Jun 02 '22 15:06 aknuds1

was this solved by https://github.com/grafana/mimir/pull/4950?

dimitarvdimitrov avatar Jun 02 '23 08:06 dimitarvdimitrov

was this solved by https://github.com/grafana/mimir/pull/4950?

No. #4950 introduced a cache for the LIST objects API call, but it's (intentionally) just used when synching rule groups and not by ruler config APIs. I considered it when working on #4950, but I want the ruler config APIs to be strongly consistent. Introducing a cache in the ruler config APIs also introduces the problem of invalidating the cache whenever it changes and, unless complicated solutions, there would be race conditions causing the ruler config APIs to return stale data. I still prefer to guarantee the ruler config API to be strongly consistent, as far as the object storage is.

pracucci avatar Jun 06 '23 04:06 pracucci

Related #9386

56quarters avatar Oct 01 '24 13:10 56quarters