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

Blocked streams under heavy load #69

Open
netvipe opened this issue Mar 13, 2020 · 5 comments
Open

Blocked streams under heavy load #69

netvipe opened this issue Mar 13, 2020 · 5 comments

Comments

@netvipe
Copy link

netvipe commented Mar 13, 2020

smux starts blocking/dropping segments when under heavy load.
When forwarding rate is below my link rate (>100 Mbps) everything is fine.
Once the rate goes above 100 Mbps, smux starts to block exisitng and new streams.
This applies to client and to server role.

I've spent too much time with tracing and debugging my code and finally decided
to switch back to yamux. Problem disappeared immediatelly.

Please support.

@xtaci
Copy link
Owner

xtaci commented Mar 14, 2020

which protocol version are you using, 1 or 2?

@xtaci
Copy link
Owner

xtaci commented Mar 14, 2020

if we've reached the bandwidth limit,then:

  1. the bandwidth shaper starts to work,streams have priority to send data, may block temporarily for old streams.
  2. the receiver buffer may be full, or the sender-side streams block on writing, if receiver-side streams don't take away their data immediately. (try increase smuxbuf and streambuf(protocol version 2)).

@netvipe
Copy link
Author

netvipe commented Mar 14, 2020

I'm using version 1.

It's not only that the buffer is full, the whole connection state becomes undefined.
The client role return status IsClosed = false even though the peer and underlying transport is fully disconnected.

I'll try with version 2. Let's see how it behaves under my traffic conditions.

@xtaci
Copy link
Owner

xtaci commented Mar 14, 2020

#59

@netvipe
Copy link
Author

netvipe commented Mar 14, 2020

Tested the following:

  • increased buffers (by 2) and version 1: stream blocks (same issue)
  • increased buffers (by 8) and version 1: works
  • defaults and version 2: works

Adaptive peer window makes the difference. I'll test a bit more with version 2.

Many thanks!

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

No branches or pull requests

2 participants