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

store-gateway: record index header loading times separately #5011

Merged

Conversation

dimitarvdimitrov
Copy link
Contributor

@dimitarvdimitrov dimitarvdimitrov commented May 15, 2023

What this PR does

Currently, the time to load an index can either be attributed to loading expand_postings or to fetch_series_and_chunks. This depends on which stage needed to read the index header first (posting lists vs symbols). This makes it harder to tell whether there's something in either of those two stages which increases latency or it's the index header.

This PR forces to load an index header upon opening a bucketIndexReader. Then records this time in a new stage in cortex_bucket_store_series_request_stage_duration_seconds - load_index.

Which issue(s) this PR fixes or relates to

Fixes #4881

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Currently, the time to load an index can either be attributed to loading `expand_postings` or to `fetch_series_and_chunks`.
This depends on which stage needed to read the index header first (posting lists vs symbols).
This makes it harder to tell whether there's something in either of those two stages which increases
latency or it's the index header.

This PR forces to load an index header upon opening a `bucketIndexReader`. Then records this time
in a new stage in `cortex_bucket_store_series_request_stage_duration_seconds` - `load_index`.

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
@pracucci pracucci self-requested a review May 15, 2023 12:31
pkg/storegateway/bucket.go Show resolved Hide resolved
pkg/storegateway/stats.go Show resolved Hide resolved
pkg/storegateway/bucket.go Show resolved Hide resolved
@dimitarvdimitrov dimitarvdimitrov enabled auto-merge (squash) May 17, 2023 09:02
@dimitarvdimitrov dimitarvdimitrov merged commit 65ac1b9 into main May 17, 2023
@dimitarvdimitrov dimitarvdimitrov deleted the dimitar/st-gw/record-index-header-loading-separately branch May 17, 2023 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

store-gateway: measure index header lazy-loading separately from stage durations
2 participants