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

Query frontend: Add benchmarks for labels codec and query range codec #4723

Merged
merged 3 commits into from
Oct 6, 2021

Conversation

matej-g
Copy link
Collaborator

@matej-g matej-g commented Oct 1, 2021

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

As a part of working on query frontend performance related task (#4571), I'm adding benchmarks to query frontend packages for codecs.

Results:

queryfrontend ❯ go test -bench=.                                                                     query-frontend-benchmarks
goos: linux
goarch: amd64
pkg: github.com/thanos-io/thanos/pkg/queryfrontend
cpu: Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz
BenchmarkLabelsCodecEncodeAndDecodeRequest/SeriesRequest-12               217172              5070 ns/op            3496 B/op         44 allocs/op
BenchmarkLabelsCodecEncodeAndDecodeRequest/LabelsRequest-12               165806              7023 ns/op            3937 B/op         57 allocs/op
BenchmarkLabelsCodecDecodeResponse/SeriesResponse-12                      335694              3269 ns/op            2056 B/op         34 allocs/op
BenchmarkLabelsCodecDecodeResponse/SeriesResponseWithHeaders-12           279236              3689 ns/op            2528 B/op         39 allocs/op
BenchmarkLabelsCodecDecodeResponse/LabelsResponse-12                      569709              2272 ns/op            1328 B/op         20 allocs/op
BenchmarkLabelsCodecDecodeResponse/LabelsResponseWithHeaders-12           468223              2578 ns/op            1800 B/op         25 allocs/op
BenchmarkLabelsCodecMergeResponses_1/SeriesResponses-12                  1980333               635.0 ns/op           368 B/op         10 allocs/op
BenchmarkLabelsCodecMergeResponses_1/LabelsResponses-12                 460894840                2.546 ns/op           0 B/op          0 allocs/op
BenchmarkLabelsCodecMergeResponses_10/SeriesResponses-12                  216445              5103 ns/op            2929 B/op         68 allocs/op
BenchmarkLabelsCodecMergeResponses_10/LabelsResponses-12                  659503              1676 ns/op             593 B/op          4 allocs/op
BenchmarkLabelsCodecMergeResponses_100/SeriesResponses-12                  18146             63734 ns/op           31966 B/op        618 allocs/op
BenchmarkLabelsCodecMergeResponses_100/LabelsResponses-12                  51276             22847 ns/op            7151 B/op         11 allocs/op
BenchmarkLabelsCodecMergeResponses_1000/SeriesResponses-12                  1598            699492 ns/op          342276 B/op       6046 allocs/op
BenchmarkLabelsCodecMergeResponses_1000/LabelsResponses-12                  3666            298388 ns/op          101812 B/op         36 allocs/op
BenchmarkQueryRangeCodecEncodeAndDecodeRequest-12                         169071              6655 ns/op            4000 B/op         58 allocs/op
PASS
ok      github.com/thanos-io/thanos/pkg/queryfrontend   19.568s

Verification

Benchmarks ran

Signed-off-by: Matej Gera <matejgera@gmail.com>
Signed-off-by: Matej Gera <matejgera@gmail.com>
yeya24
yeya24 previously approved these changes Oct 3, 2021
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the benchmark tests.
For the performance issue of query frontend, what's next and what's the conclusion from the benchmark results?

GiedriusS
GiedriusS previously approved these changes Oct 5, 2021
Copy link
Member

@GiedriusS GiedriusS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one nit

pkg/queryfrontend/labels_codec_test.go Outdated Show resolved Hide resolved
Signed-off-by: Matej Gera <matejgera@gmail.com>
@matej-g matej-g dismissed stale reviews from GiedriusS and yeya24 via c592503 October 6, 2021 08:03
@matej-g
Copy link
Collaborator Author

matej-g commented Oct 6, 2021

LGTM for the benchmark tests. For the performance issue of query frontend, what's next and what's the conclusion from the benchmark results?

You can read the conclusion at #4571 (comment) - tl;dr: I could not confirm any performance issue despite the initial reports we received. The sentiment was that it would still be nice to have some benchmarks for query frontend, but for now the results look in order to me.

Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GiedriusS GiedriusS merged commit 039818e into thanos-io:main Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants