mirror of https://github.com/grafana/loki
Index Gateway: Set some concurrency limits around concurrent index table processing (#10768)
**What this PR does / why we need it**:
This addresses an issue we've seen with index gateways when handling
queries that touch a large number of series, although these are
improvements not necessarily solutions.
We've seen a tremendous amount of goroutines being spawned while
processing GetChunkRefs requests, specifically when the gateways have
recently found a lot of uncompacted recent ingester tables.
This PR puts some limits on the parallelism of processing tables, the
implementation is a bit arbitrary, we limit the concurrent iterations to
GOMAXPROCS/2
In practice this is potentially still too much as an index gateway will
be serving many requests in parallel witch each able to do parallel
table iteration, however it's a more reasonable line in the sand than
having no limits and eases some pressure on the Go scheduler.
**Which issue(s) this PR fixes**:
Fixes #<issue number>
**Special notes for your reviewer**:
**Checklist**
- [ ] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [ ] `CHANGELOG.md` updated
- [ ] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/setup/upgrade/_index.md`
- [ ] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](d10549e3ec)
---------
Signed-off-by: Edward Welch <edward.welch@grafana.com>
pull/10804/head
parent
e2ed1c01d4
commit
0c58c78828
Loading…
Reference in new issue