-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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: improve index header reading performance by sorting values #5588
Conversation
0aa5dda
to
99b95f7
Compare
6968ad2
to
5d85a15
Compare
5d85a15
to
b0b87fa
Compare
Thank you for this! Benchmark diff:
One has even increased 😱 do you get similar results? It seems like there isn't much of an improvement 🤔 I haven't had enough time to look deeply into this. Perhaps you know the reason? |
Try this: https://gist.github.com/damnever/b5bf73877185dc24fa087792cc7b284a There is only a 50k series in total, select 20k from it.
I'd expect a better result on HDD. |
Thanks! I think it makes sense to have this merged. The latency spike is mostly on small (10 values), so it's fine. But I believe we would love your benchmark to have in, so any other developer can verify and we can also ensure next changes maintains the same level of efficiency 🤗 WDYT @damnever ? |
Signed-off-by: Xiaochao Dong (@damnever) <[email protected]>
ceee652
to
3bbc041
Compare
The benchmark test has been updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 💪🏽
…st (thanos-io#5588) Signed-off-by: Xiaochao Dong (@damnever) <[email protected]> Signed-off-by: Xiaochao Dong (@damnever) <[email protected]>
Users may construct a promQL like
metric{key=~"b|z|..tens of thousands..|a"}
with Grafana variables or code, which is extremely slow.In our environment, the index header is ~99MiB per block, the CPU usage has doubled immediately when the store gateway receives a query like this(which contains ~15000 values separated by |)..
I have seen Prometheus already does something like this: https://github.com/prometheus/prometheus/blob/bcd548c88b06543c8eeb19e68bef4adefb7b95fb/tsdb/querier.go#L321
Changes
Verification