use BDP in SWQOS calculations#7706
Closed
alexpyattaev wants to merge 2 commits intoanza-xyz:masterfrom
Closed
Conversation
alexpyattaev
commented
Aug 25, 2025
| drop(connection_table_l); | ||
|
|
||
| if let Ok(receive_window) = receive_window { | ||
| connection.set_receive_window(receive_window); |
alexpyattaev
commented
Aug 25, 2025
|
|
||
| /// Maximal allowed RTT for SWQOS calculations (to limit abuse) | ||
| const MAX_ALLOWED_RTT: Duration = Duration::from_millis(200); | ||
|
|
Author
There was a problem hiding this comment.
These are just placeholder values to be tuned.
alexpyattaev
commented
Aug 25, 2025
| .. | ||
| } = params; | ||
|
|
||
| let max_receive_rate_kbps = compute_max_receive_rate_kbps(params.max_stake, params.peer_type); |
Author
There was a problem hiding this comment.
we compute the RX window immediately after connection is confirmed
alexpyattaev
commented
Aug 25, 2025
| stats.total_streams.fetch_sub(1, Ordering::Relaxed); | ||
| stream_load_ema.update_ema_if_needed(); | ||
|
|
||
| let new_window = compute_receive_window_bdp(max_receive_rate_kbps, connection.rtt()); |
Author
There was a problem hiding this comment.
and we re-compute it after a full stream is received to keep it in line with what is going on in the channel
alexpyattaev
commented
Aug 25, 2025
| min_stake = 10000; | ||
| let ratio = compute_receive_window_ratio_for_staked_node(max_stake, min_stake, max_stake); | ||
| assert_eq!(ratio, max_ratio); | ||
|
|
Author
There was a problem hiding this comment.
Since we embrace min_stake == 0 we can eliminate this part of the test.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #7706 +/- ##
=======================================
Coverage 83.0% 83.0%
=======================================
Files 812 812
Lines 356934 356907 -27
=======================================
+ Hits 296535 296557 +22
+ Misses 60399 60350 -49 🚀 New features to boost your workflow:
|
61bb7f1 to
b578e98
Compare
do not update RX window on every TX, only every 64 TXs bump max RTT to 300ms based on popular request
b578e98 to
f79a707
Compare
Author
|
closing in favor of #7954 |
This file contains hidden or 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
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.
Problem
Streamer does not allow larger RX windows for peers with larger RTT, as a result they can not achieve target rates
Summary of Changes
Measurements before change:
and after:
A more complete rework is available in #7745