Skip to content

Opmize GetLabels and GetLabels values from store gateway #5820

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alanprot
Copy link
Member

@alanprot alanprot commented Mar 18, 2024

What this PR does:
Right now, we wait the result from all store gateways be returned to only then Merge/Dedup the response.

This change is similar to what was done on: #5785

➜  ~ ~/go/bin/benchstat /tmp/old /tmp/new
goos: darwin
goarch: arm64
pkg: github.com/cortexproject/cortex/pkg/querier
                             │  /tmp/old   │              /tmp/new              │
                             │   sec/op    │   sec/op     vs base               │
BlocksStoreQuerier_Labels-10   3.013m ± 1%   2.147m ± 0%  -28.76% (p=0.002 n=6)

                             │   /tmp/old   │              /tmp/new               │
                             │     B/op     │     B/op      vs base               │
BlocksStoreQuerier_Labels-10   8.832Mi ± 0%   2.151Mi ± 0%  -75.64% (p=0.002 n=6)

                             │  /tmp/old   │             /tmp/new              │
                             │  allocs/op  │  allocs/op   vs base              │
BlocksStoreQuerier_Labels-10   20.06k ± 0%   19.84k ± 0%  -1.10% (p=0.002 n=6)

Which issue(s) this PR fixes:
Fixes #

Checklist

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

@alanprot alanprot requested a review from yeya24 March 18, 2024 23:00
@alanprot alanprot marked this pull request as ready for review March 20, 2024 17:00
@yeya24
Copy link
Contributor

yeya24 commented Mar 21, 2024

@alanprot Can we provide some kind of go benchmark results?

Signed-off-by: alanprot <alanprot@gmail.com>
@alanprot
Copy link
Member Author

@yeya24 Update the PR to use the MergeSlicesParallel and added a bench.

It seems better but maybe we need more tests? like with different number of labels being returned?

Signed-off-by: alanprot <alanprot@gmail.com>
Copy link

stale bot commented Apr 26, 2025

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 26, 2025
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.

2 participants