forked from grafana/loki
-
Notifications
You must be signed in to change notification settings - Fork 3
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 #3
Merged
cyriltovena
merged 13 commits into
cyriltovena:frontend-cleaned
from
owen-d:query-frontend
Jan 6, 2020
Merged
Query frontend #3
cyriltovena
merged 13 commits into
cyriltovena:frontend-cleaned
from
owen-d:query-frontend
Jan 6, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cyriltovena
reviewed
Jan 6, 2020
cyriltovena
pushed a commit
that referenced
this pull request
Jan 6, 2020
* 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
cyriltovena
added a commit
that referenced
this pull request
Jan 7, 2020
* Adds frontend to Loki. Signed-off-by: Cyril Tovena <[email protected]> * Improves tests. Signed-off-by: Cyril Tovena <[email protected]> * Fixes sneaky bug in entries sorting. Signed-off-by: Cyril Tovena <[email protected]> * Fixes the split by interval. Signed-off-by: Cyril Tovena <[email protected]> * Tweak jsonnet deployments and add a way to lint/fmt. Signed-off-by: Cyril Tovena <[email protected]> * lint. Signed-off-by: Cyril Tovena <[email protected]> * fix timezone issue. Signed-off-by: Cyril Tovena <[email protected]> * Improve tests and rollback change in loghttp package. Signed-off-by: Cyril Tovena <[email protected]> * Fixes a flaky test that might run one more goroutine. Signed-off-by: Cyril Tovena <[email protected]> * Fixes windows build. Signed-off-by: Cyril Tovena <[email protected]> * Improve tracing in the split by interval. Signed-off-by: Cyril Tovena <[email protected]> * Add test stream to proto conversion. Signed-off-by: Cyril Tovena <[email protected]> * Fixes flappy retry test. Signed-off-by: Cyril Tovena <[email protected]> * Remove err shadowing in stopQueryFrontend as it was confusing. Signed-off-by: Cyril Tovena <[email protected]> * Refactor grpc message size in the libsonnet config file. Signed-off-by: Cyril Tovena <[email protected]> * Don't check auth header for GRPC TransferChunks. Signed-off-by: Cyril Tovena <[email protected]> * Query frontend (#3) * 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 * Removes unused logRequest. Signed-off-by: Cyril Tovena <[email protected]> * Sets the cache interval to the same split interval. Signed-off-by: Cyril Tovena <[email protected]> * Missing import libsonnet for the frontend. Signed-off-by: Cyril Tovena <[email protected]> * Frontend should not be a cluster IP. Signed-off-by: Cyril Tovena <[email protected]> Co-authored-by: Owen Diehl <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This includes two changes.
Codec performance improvements for merging responses.
We now take advantage of the fact that split responses are already ordered and don't overlap. This includes
O(n*log(n))
instead ofO(m*log(m))
wheren = num_intervals, m = num_entries
O(n*log(k))
wheren = limit, k = num_streams
by using a new priority queue impl.The
splitByInterval
middleware has been changed significantly.Previously it split time ranges twice, the first for serial execution and the second for parallel execution within the first.
Now we split one time and use a channel to determine parallelism. This avoids queries in a later interval being convoyed behind a slow (retrying, etc) earlier query. It simplifies the execution model while making it less prone to blocking.
If requested, we can also add a
backpressure
parameter to thesplitByInterval
middleware which would prevent scheduling later queries if we're still waiting on an earlier query frombackpressure
previous intervals.