-
Notifications
You must be signed in to change notification settings - Fork 16
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
Balanced channel measures RTT, hoping to stay within AZ (and save $) #794
Merged
Merged
Changes from 22 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
5c39335
Balanced measures RTT using OPTIONS requests
iamdanfox bc5b31d
Compile
iamdanfox 109b05d
Handl OPTIONS
iamdanfox 4661549
Update simulations
iamdanfox 17c248e
Updatee tests for rtt sampling
iamdanfox a5e7531
Accumulate RTT average
iamdanfox e398af0
Sample all channels, with two sequential calls
iamdanfox 0701a64
Also log accumulated ones
iamdanfox bef11a4
Just store the min
iamdanfox 2284f62
Compute score based on the range of observed rtts
iamdanfox 961b240
Delete misleading method
iamdanfox 3c2dc94
Fix unit tests
iamdanfox 9514f91
Update simulations
iamdanfox cb3b440
streams are fine here
iamdanfox 9398d9a
test for rate limiter
iamdanfox b17e311
Simulations
iamdanfox 3beac0f
Smaller diff
iamdanfox c40950f
Add generated changelog entries
iamdanfox c913334
Don't allow multiple samples to run at the same time
iamdanfox 7005529
Return the min of the last 5 measurements
iamdanfox 4c4ce91
Move sorting
iamdanfox 7f9db17
Refactor
iamdanfox 64a955b
Pull everything out to a dedicated 'RttSampler' class
iamdanfox 2389a06
Use OptionalLong instead of Long.MAX_VALUE as special value
iamdanfox 3adc16c
be more immutable, reduce diff
iamdanfox eb76abb
Feature flag it off
iamdanfox 4f73a90
Allow servers to enable it with BALANCED_RTT
iamdanfox f364205
Re-run simulations
iamdanfox 6f9804a
Fix tests
iamdanfox d81eb17
Merge remote-tracking branch 'origin/develop' into dfox/rtt
iamdanfox c0a90b4
Merge remote-tracking branch 'origin/develop' into dfox/rtt
iamdanfox 384cf55
Merge branch 'dfox/rtt' of ssh://github.com/palantir/dialogue into df…
iamdanfox 0128c4e
Ensure we send a good user agent with these OPTIONS requests
iamdanfox 1af6a22
More CR
iamdanfox f156637
Move logic to RttSampler
iamdanfox f62429d
Appease errorprone
iamdanfox d873cd1
Minimise diff
iamdanfox f6f6917
Remember to close the response!
iamdanfox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type: feature | ||
feature: | ||
description: Balanced channel now biases towards whichever node has the lowest latency, | ||
which should reduce AWS spend by routing requests within AZ. | ||
links: | ||
- https://github.com/palantir/dialogue/pull/794 |
279 changes: 237 additions & 42 deletions
279
...e-core/src/main/java/com/palantir/dialogue/core/BalancedNodeSelectionStrategyChannel.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
4 changes: 2 additions & 2 deletions
4
simulation/src/test/resources/all_nodes_500[CONCURRENCY_LIMITER_ROUND_ROBIN].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
simulation/src/test/resources/black_hole[CONCURRENCY_LIMITER_ROUND_ROBIN].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
simulation/src/test/resources/live_reloading[CONCURRENCY_LIMITER_ROUND_ROBIN].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
simulation/src/test/resources/one_big_spike[CONCURRENCY_LIMITER_ROUND_ROBIN].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...resources/one_endpoint_dies_on_each_server[CONCURRENCY_LIMITER_ROUND_ROBIN].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
4 changes: 2 additions & 2 deletions
4
...src/test/resources/server_side_rate_limits[CONCURRENCY_LIMITER_ROUND_ROBIN].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...st/resources/slowdown_and_error_thresholds[CONCURRENCY_LIMITER_ROUND_ROBIN].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
simulation/src/test/resources/txt/all_nodes_500[CONCURRENCY_LIMITER_ROUND_ROBIN].txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
success=73.7% client_mean=PT3.039455S server_cpu=PT20M client_received=2000/2000 server_resps=2000 codes={200=1474, 500=526} | ||
success=73.6% client_mean=PT2.91032S server_cpu=PT20M client_received=2000/2000 server_resps=2000 codes={200=1472, 500=528} |
Oops, something went wrong.
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.
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.
peanut gallery: I want an error-prone rule that can refactor this automatically
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.
That would be pretty cool! Think we just need to improve https://github.com/palantir/gradle-baseline/blob/15661f333a76997d0a5b79a52af8767e01a86ca1/baseline-error-prone/src/main/java/com/palantir/baseline/errorprone/LambdaMethodReference.java#L45 to handle more than suppliers
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.
there ya go: palantir/gradle-baseline#1359