Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache index stats requests #8973

Closed
salvacorts opened this issue Mar 31, 2023 · 0 comments · Fixed by #8972
Closed

Cache index stats requests #8973

salvacorts opened this issue Mar 31, 2023 · 0 comments · Fixed by #8972

Comments

@salvacorts
Copy link
Contributor

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

The load of index stats requests to our index gateways recently increased due to:

Describe the solution you'd like

Many of these requests could be cached to ease the load of our index gateways. This cache could be easily implemented in the query frontend by reusing the results cache.

Describe alternatives you've considered

Could be worth evaluating adding some index-level caching mechanism in the index gateway itself as Mimir currently does:
https://github.com/grafana/mimir/blob/main/pkg/storegateway/indexcache/cache.go

Additional context
Add any other context or screenshots about the feature request here.

@salvacorts salvacorts self-assigned this Mar 31, 2023
salvacorts added a commit that referenced this issue Apr 18, 2023
**What this PR does / why we need it**:

As described in #8973, we are
substantially increasing the load of index stat requests we sent to our
index gateways. Many of these requests should be easily re-used by
caching them.

This PR adds caching for index stat requests by reusing the results
cache. Here's a demo ([source][1]):


![image](https://user-images.githubusercontent.com/8354290/229104609-4dd26f0a-9260-4f21-85ef-ac4a86ebba7a.png)

**Which issue(s) this PR fixes**:
Fixes #8973

**Special notes for your reviewer**:

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [x] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`

[1]:
https://ops.grafana-ops.net/d/afcaef21-e5ad-49e7-ab06-42a9d7d915eb/index-stats?orgId=1&var-datasource=dev-cortex&var-cluster=dev-eu-west-2&var-namespace=loki-dev-009&var-loki_datasource=Grafana%20Logging&from=1680259907288&to=1680260431814&var-operation=All

---------

Co-authored-by: Owen Diehl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant