Skip to content
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

yamux: increase yamux window size to 8MiB. #6049

Merged
merged 1 commit into from
Mar 5, 2019
Merged

Conversation

Stebalien
Copy link
Member

This should be variable. But, until we can get around to fixing that, 8MiB means a max speed of 40MiB given a 200ms RTT. The current limit gives us a 2.5MiB max rate which really hurts.

Note: We now auto-shrink this buffer as needed (using a buffer pool) so this
shouldn't leak memory.

@Stebalien Stebalien requested a review from Kubuxu as a code owner March 5, 2019 02:22
@ghost ghost assigned Stebalien Mar 5, 2019
@ghost ghost added the status/in-progress In progress label Mar 5, 2019
@vyzo
Copy link
Contributor

vyzo commented Mar 5, 2019

we should do this in whyrusleeping/go-smux-yamux so that all libp2p programs benefit.

core/core.go Outdated
@@ -418,7 +418,7 @@ func makeSmuxTransportOption(mplexExp bool) libp2p.Option {
ConnectionWriteTimeout: time.Second * 10,
KeepAliveInterval: time.Second * 30,
EnableKeepAlive: true,
MaxStreamWindowSize: uint32(1024 * 512),
MaxStreamWindowSize: uint32(1024 * 8192),
Copy link
Member

@Kubuxu Kubuxu Mar 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MaxStreamWindowSize: uint32(1024 * 8192),
MaxStreamWindowSize: uint32(8 << 20),

I think it is much cleaner in showing it is 8MB.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed it to 8 * 1024 * 1024. I'm really not a fan of 8<<20.

This _should_ be variable. But, until we can get around to fixing that, 8MiB
means a max speed of 40MiB given a 200ms RTT. The current limit gives us a
2.5MiB max rate which _really_ hurts.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
@Stebalien Stebalien merged commit 918dcbe into master Mar 5, 2019
@ghost ghost removed the status/in-progress In progress label Mar 5, 2019
@Stebalien Stebalien deleted the fix/yamux-window-size branch March 5, 2019 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants