Skip to content

Commit

Permalink
feat(yamux): auto-tune (dynamic) stream receive window
Browse files Browse the repository at this point in the history
libp2p/rust-yamux#176 enables auto-tuning for the Yamux stream receive window. While preserving small buffers on low-latency and/or low-bandwidth connections, this change allows for high-latency and/or high-bandwidth connections to exhaust the available bandwidth on a single stream.

Using the [libp2p perf](https://github.com/libp2p/test-plans/blob/master/perf/README.md) benchmark tools (60ms, 10Gbit/s) shows an **improvement from 33 Mbit/s to 1.3 Gbit/s** in single stream throughput.

See libp2p/rust-yamux#176 for details.

To ship the above Rust Yamux change in a libp2p patch release (non-breaking), this pull request uses `yamux` `v0.13` (new version) by default and falls back to `yamux` `v0.12` (old version) when setting any configuration options. Thus default users benefit from the increased performance, while power users with custom configurations maintain the old behavior.

Pull-Request: #4970.
  • Loading branch information
mxinden authored Dec 6, 2023
1 parent 06d80fb commit f40cc4e
Show file tree
Hide file tree
Showing 4 changed files with 184 additions and 60 deletions.
20 changes: 19 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions muxers/yamux/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
It does not enforce flow-control, i.e. breaks backpressure.
Use `WindowUpdateMode::on_read` instead.
See `yamux` crate version `v0.12.1` and [Yamux PR #177](https://github.com/libp2p/rust-yamux/pull/177).
- `yamux` `v0.13` enables auto-tuning for the Yamux stream receive window.
While preserving small buffers on low-latency and/or low-bandwidth connections, this change allows for high-latency and/or high-bandwidth connections to exhaust the available bandwidth on a single stream.
Have `libp2p-yamux` use `yamux` `v0.13` (new version) by default and fall back to `yamux` `v0.12` (old version) when setting any configuration options.
Thus default users benefit from the increased performance, while power users with custom configurations maintain the old behavior.
`libp2p-yamux` will switch over to `yamux` `v0.13` entirely with the next breaking release.
See [PR 4970](https://github.com/libp2p/rust-libp2p/pull/4970).

## 0.45.0

Expand Down
4 changes: 3 additions & 1 deletion muxers/yamux/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ keywords = ["peer-to-peer", "libp2p", "networking"]
categories = ["network-programming", "asynchronous"]

[dependencies]
either = "1"
futures = "0.3.29"
libp2p-core = { workspace = true }
thiserror = "1.0"
yamux = "0.12"
yamux012 = { version = "0.12.1", package = "yamux" }
yamux013 = { version = "0.13.1", package = "yamux" }
tracing = "0.1.37"

[dev-dependencies]
Expand Down
Loading

0 comments on commit f40cc4e

Please sign in to comment.