-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Loki Query Frontend #1442
Loki Query Frontend #1442
Conversation
53170ee
to
66dda4f
Compare
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.
I have a few questions, but it's looking great!
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.
It would be good to have a small change done which Owen pointed out already, otherwise it LGTM.
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
* frontend codec merging optimizations * codec benchmarks * removes unused bounds code in queryrange ordering * [wip] splitby uses channels instead of sub batching intervals * splitBy channel limit test * single allocation for merging entries from a single stream * skip merging loki responses when limit is already hit * removes checks for unlimited queries in queryrange * removes splitByInterval{,.interval} spans * removes interval_batch_size from jsonnet lib * moves benchmark utils to own file * renames markers -> entries * priority queue comments
6b23951
to
8f7c437
Compare
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
Signed-off-by: Cyril Tovena <[email protected]>
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.
Let's Get This Merged!
dam windows |
Fix the version of protobuf and pin tools in the build image.
After many refactoring PRs in Cortex, this PR introduces a
query-frontend
component in loki.The
query-frontend
sits in front of queriers and communicates with them to dispatch work, allowing parallelization and queries speed improvement.I have been running the frontend for a month in dev and it really shows promising result. However it definitely requires bigger queriers pool compared to Cortex.
The current implementation targets specifically slow queries.
Metrics queries
Metrics queries like cortex will be aligned, splitted by 4 hours by default and result cached. In fact we are using the same set of middlewares.For some streams 4 hours block can still be too much (high throughput), but I expect the sharding parallelization to split again those 4 hours block into 16 (Future works), in the meantime you can tweak the interval to a lower range.
Log Regex queries
Log regex queries are splitted also by interval of 4 hours, however compared to cortex they are run in sequence and each block is splitted by 16 (configurable) and run in parallel. This allows to check for every 4 hours if we already have enough result before moving to the next block.
Anything else (non regex log queries, labels, etc...) run the same way but still goes through the frontend. Except for labels names queries I actually don't plan any work since those queries are already very fast. (500~700ms)
The loki jsonnet library has been updated.
PS: I had to update to latest cortex and there were some changes related to the ring and some vendoring issue.
Next steps :
/cc @slim-bean @tomwilkie @joe-elliott @rfratto
Here is a screenshot of a trace for a regex queries on an high throughput stream:
This is not yet part of the single binary, I still need to think about how we want to design this, it could be very nice to swap grpc for direct querier library calls.