Repository navigation
perf(transport): auto-tune stream receive window #1868
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
Merged
Merged
Changes from 59 commits
Commits
Show all changes
98 commits
Select commit
Hold shift + click to select a range
c0a72ce
test(transport): maximum throughput on unlimited bandwidth and 50ms
mxinden 5c2aa4c
feat: auto-tune stream receive window
mxinden 1bfd2f5
clippy
mxinden 167d93f
Merge branch 'main' of https://github.com/mozilla/neqo into auto-tuning
mxinden edc4035
fix tests
mxinden 12390c8
Don't increase on STREAM_DATA_BLOCKED
mxinden 0ad1b77
enforce STREAM_MAX_ACTIVE_LIMIT
mxinden 8e6a5af
add TODO starting below 1MiB
mxinden 716ba20
Add NonRandomDelay
mxinden 3b2a52b
Reduce transfer amount and throughput expectation
mxinden dba8190
Merge branch 'main' of https://github.com/mozilla/neqo into auto-tuning
mxinden 9b9524e
Merge branch 'main' of https://github.com/mozilla/neqo into auto-tuning
mxinden 1b2a370
test(transport): assert maximum bandwidth on gbit link
mxinden ac5d024
debugging
mxinden 22f1d7e
Merge branch 'main' of https://github.com/mozilla/neqo into auto-tuning
mxinden db3cfe5
deduplicate in fc.rs
mxinden 62dc2ba
Google vs Thomson vs BDP
mxinden 841d086
More testing
mxinden 5ec58cb
Adjust bench
mxinden 6dd3829
Move to benchmark
mxinden a6fc729
fix(sim): correct `Waiting` state comparison in `NodeHolder::ready()`
mxinden f9b9a27
Add TODO on sent rtt in receive auto-tuning
mxinden 8aff641
update every rtt/4 and don't use floating point division
mxinden 4a146e6
Settle on Thomson algorithm
mxinden 5e7d7d6
More aggressive increase
mxinden 7d19f66
Limit send buffer
mxinden 6ad6cda
Merge branch 'main' of https://github.com/mozilla/neqo into auto-tuning
mxinden 86f72ef
restrict send buffer
mxinden 673f7e6
Obsolete note
mxinden 327d28b
Introduce MAX_SEND_BUFFER_SIZE
mxinden 6bf1616
Renames
mxinden fd8d8bd
Fix unit tests
mxinden 4ff2a0c
Write qlogs when QLOGDIR is set
mxinden 432a83e
Add Mtu simulator Node
mxinden d26df37
cleanups
mxinden 09be7df
Remove INITIAL_SEND_BUFFER_SIZE
mxinden 13f848d
Fix import
mxinden 42324d7
Cleanup bench
mxinden b8f742a
Move bench
mxinden 78add98
Checkin min_bandwidth
mxinden 3e04c76
Add license header
mxinden daa8acc
Use MBIT
mxinden 3f8679f
Update max_data test
mxinden 719a957
rename fraction const
mxinden a871dba
document correlation with DEFAULT_ACK_RATIO
mxinden c66140a
document max_allowed_sent_at
mxinden 21cda8b
remove bandwidth debug
mxinden afa9a5e
Document auto-tuning algorithm
mxinden 7b423b9
Rename Delay to RandomDelay
mxinden bf478c1
Remove RX_STREAM_DATA_WINDOW
mxinden 43e4860
Remove wrong comment
mxinden 569c5fa
Remove debugging assert
mxinden 7ad539d
Remove wrong comment
mxinden a5df1d8
Update *Delay Debug impl
mxinden e5ba77b
Remove comment
mxinden 1e3dd80
Outdated comment
mxinden 2934ffa
Document Mtu node impl
mxinden 8e0c6d8
Refactor fc_state_recv_7
mxinden 4efa2f2
Remove todo to shrink buffer
mxinden e68813e
Remove outdated todo
mxinden e808b51
Add max_send_buffer_size test
mxinden 57c2870
Merge remote-tracking branch 'mozilla/main' into auto-tuning
mxinden ba2c321
Clippy
mxinden 6de63fb
Clippy
mxinden aba14e9
Plan tests
mxinden 4ee45fc
Add tests
mxinden 82eb50b
Fix min_bandwidth
mxinden fb51122
Add quick check style test
mxinden 1fa5a77
Interleaving test
mxinden 6cb8de9
Rational for MAX_RECV_WINDOW_SIZE
mxinden f10cf32
Clippy
mxinden 8419c3f
Fix test
mxinden 5724444
Fix intra doc links
mxinden 4d70b34
Expose raw bandwidth
mxinden 08c2d37
Use LINK_BANDWIDTH const
mxinden 68291d8
Merge branch 'main' of https://github.com/mozilla/neqo into auto-tuning
mxinden 2966b4f
Merge branch 'main' into auto-tuning
larseggert bc4cb4e
Fixes to get the bench to run
larseggert d1e5eb5
Merge remote-tracking branch 'mozilla/main' into auto-tuning
mxinden 397fdd3
Rename max_allowed_sent_at to last_update
mxinden 90a7a20
Fix changing_max_active unit test to not underflow
mxinden 200aaef
Rename to should_send_update
mxinden 9b775a7
Implement Martin's _excess_ algorithm
mxinden 6ef14bc
Apply clippy suggestions
mxinden 8547d7f
Increase minimum expected utilization
mxinden b6640b9
More clippy
mxinden fb11191
fmt
mxinden 97d0ea9
Update neqo-transport/src/fc.rs
mxinden f0494ed
Update neqo-transport/src/fc.rs
mxinden bbf09a5
Improve auto_tuning_increase_no_decrease assert comments
mxinden 40f861f
Update neqo-transport/src/fc.rs
mxinden 1a97373
Remove TODO on receive buffer shrinking
mxinden 54d9d7b
Impl From<Option<Datagram>> for Output
mxinden fbc1fb5
Improve MAX_SEND_BUFFER_SIZE doc comment
mxinden fecce20
Update neqo-transport/src/fc.rs
mxinden 8ad5563
Update neqo-transport/src/recv_stream.rs
mxinden 875b93e
Document QLOGDIR environment variable
mxinden 62ba132
fmt
mxinden 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 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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
| // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
| // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
| // option. This file may not be copied, modified, or distributed | ||
| // except according to those terms. | ||
|
|
||
| //! A simulated transfer benchmark, asserting a minimum bandwidth. | ||
| //! | ||
| //! This is using [`test_fixture::sim`], i.e. does no I/O beyond the process | ||
| //! boundary and runs in simulated time. Given that [`test_fixture::sim`] is | ||
| //! deterministic, there is no need for multiple benchmark iterations. Still it | ||
| //! is a Rust benchmark instead of a unit test due to its runtime (> 10s) even | ||
| //! in Rust release mode. | ||
|
|
||
| use std::time::Duration; | ||
|
|
||
| use neqo_transport::{ConnectionParameters, State}; | ||
| use test_fixture::{ | ||
| boxed, | ||
| sim::{ | ||
| connection::{ConnectionNode, ReachState, ReceiveData, SendData}, | ||
| network::{Delay, Mtu, TailDrop}, | ||
| Simulator, | ||
| }, | ||
| }; | ||
|
|
||
| #[allow(clippy::cast_precision_loss)] | ||
| pub fn main() { | ||
| const MIB: usize = 1_024 * 1_024; | ||
| const GIB: usize = 1_024 * MIB; | ||
|
|
||
| const MBIT: usize = 1_000 * 1_000; | ||
| const GBIT: usize = 1_000 * MBIT; | ||
|
|
||
| const TRANSFER_AMOUNT: usize = GIB; | ||
| const LINK_BANDWIDTH: usize = GBIT; | ||
| const LINK_RTT_MS: usize = 40; | ||
| const MINIMUM_EXPECTED_UTILIZATION: f64 = 0.5; | ||
|
|
||
| let gbit_link = || { | ||
| let rate_byte = GBIT / 8; | ||
| let capacity_byte = rate_byte as f64 * (LINK_RTT_MS as f64 / 1_000.0); | ||
| TailDrop::new(rate_byte, capacity_byte as usize, Duration::ZERO) | ||
| }; | ||
|
|
||
| let simulated_time = Simulator::new( | ||
| "gbit-bandwidth", | ||
| boxed![ | ||
| ConnectionNode::new_client( | ||
| ConnectionParameters::default(), | ||
| boxed![ReachState::new(State::Confirmed)], | ||
| boxed![ReceiveData::new(TRANSFER_AMOUNT)] | ||
| ), | ||
| Mtu::new(1500), | ||
| gbit_link(), | ||
| Delay::new(Duration::from_millis(LINK_RTT_MS as u64 / 2)), | ||
| ConnectionNode::new_server( | ||
| ConnectionParameters::default(), | ||
| boxed![ReachState::new(State::Confirmed)], | ||
| boxed![SendData::new(TRANSFER_AMOUNT)] | ||
| ), | ||
| Mtu::new(1500), | ||
| gbit_link(), | ||
| Delay::new(Duration::from_millis(LINK_RTT_MS as u64 / 2)), | ||
| ], | ||
| ) | ||
| .setup() | ||
| .run(); | ||
|
|
||
| let achieved_bandwidth = TRANSFER_AMOUNT as f64 * 8.0 / simulated_time.as_secs_f64(); | ||
|
|
||
| assert!( | ||
| LINK_BANDWIDTH as f64 * MINIMUM_EXPECTED_UTILIZATION < achieved_bandwidth, | ||
| "expected to reach {MINIMUM_EXPECTED_UTILIZATION} of maximum bandwidth ({} Mbit/s) but got {} Mbit/s", | ||
| LINK_BANDWIDTH / MBIT, | ||
| achieved_bandwidth / MBIT as f64, | ||
| ); | ||
| } |
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.