-
Notifications
You must be signed in to change notification settings - Fork 13
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
Do substreams have backpressure? #61
Comments
@dominictarr @christianbundy Any ideas on how we might go about implementing this? One idea is to have an ACK for each message, which would make it easy to signal backpressure, since the sink would just withhold its ACK until it's ready for more. However, it means an extra half round-trip for each stream chunk, and a change to the protocol. |
I did a rewrite on the v7 branch that was gonna implement this, but I when I deployed it it ramped up too slowly and broke stuff. I rolled back to v6 and never got around to finishing it. I think the v7 version is a big improvement too, but it needs some research into ways to detect when to change the rate of flow. on v7 it sent "credit" default 64k, and when that drained half way it would send more. but for a high latency connection this slows it down a lot... it's kinda like a train, it has lots of momentum. if you wanna go fast, it takes longer to stop. ideally, you'd have a way of measuring a the bandwidth and latency of a connection, so that you can start going at the most sensible speed. then decrease or increase from there. |
hmm, I think that could be added to the control stream (on the 7 branch) |
of course those values are only a particular connection. we need to detect what they should be on each connection, and they might change over time too |
Ha, so it's basically re-implementing TCP flow control. Does this mean sbot doesn't have backpressure on its |
Relevant thread: %xcRxdizHSOvF7uV9kVd/SKjrt3Fij37eiQFhMuId29M=.sha256 |
correct it's tcp on top of tcp. legacy replication was particularily bad because it opened potentially thousands of streams, most of which don't send any data, so maintaining back pressure for all of that would add a lot of over head. on the other hand, EBT replication is over a single stream, so far less overhead. In that thread @cryptix links to yamux... reading their "spec" they barely describe back pressure works... so it sounds similar to the naive method that v7 currently uses... |
now having some time for this to process in my subconscious I've realized that it just needs to add a ping signal in the control stream... not that hard... |
I couldn't tell by looking at the source, but I wrote this and it seems like the source gets read entirely regardless of the sink's reading capacity:
gives
The text was updated successfully, but these errors were encountered: