Skip to content

Commit f40cc4e

Browse files
authored
feat(yamux): auto-tune (dynamic) stream receive window
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.
1 parent 06d80fb commit f40cc4e

File tree

4 files changed

+184
-60
lines changed

4 files changed

+184
-60
lines changed

Cargo.lock

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

muxers/yamux/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
It does not enforce flow-control, i.e. breaks backpressure.
55
Use `WindowUpdateMode::on_read` instead.
66
See `yamux` crate version `v0.12.1` and [Yamux PR #177](https://github.com/libp2p/rust-yamux/pull/177).
7+
- `yamux` `v0.13` enables auto-tuning for the Yamux stream receive window.
8+
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.
9+
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.
10+
Thus default users benefit from the increased performance, while power users with custom configurations maintain the old behavior.
11+
`libp2p-yamux` will switch over to `yamux` `v0.13` entirely with the next breaking release.
12+
See [PR 4970](https://github.com/libp2p/rust-libp2p/pull/4970).
713

814
## 0.45.0
915

muxers/yamux/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ keywords = ["peer-to-peer", "libp2p", "networking"]
1111
categories = ["network-programming", "asynchronous"]
1212

1313
[dependencies]
14+
either = "1"
1415
futures = "0.3.29"
1516
libp2p-core = { workspace = true }
1617
thiserror = "1.0"
17-
yamux = "0.12"
18+
yamux012 = { version = "0.12.1", package = "yamux" }
19+
yamux013 = { version = "0.13.1", package = "yamux" }
1820
tracing = "0.1.37"
1921

2022
[dev-dependencies]

0 commit comments

Comments
 (0)