-
Notifications
You must be signed in to change notification settings - Fork 42
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
chore: investigate if possible to send many messages in a short amount of time (throughput is very limited in js-waku) #1443
Comments
This is interesting as I have in the past tried to re-used streams but failed to do so. I think I mainly experimented with store and not light push |
while it shouldn't matter, but with js-libp2p example gossipsub is directly being used (no wait for ack), while lightpush uses req-res model (per stream) and requires to wait for ack. if OP wants to parallelise and send multiple messages using lightpush over js-libp2p, configuring this options to increase max outbound streams should help: https://github.com/libp2p/js-libp2p/blob/5ffa7a74d5b972bdac387782d6010b6a19558600/packages/pubsub-gossipsub/src/stream.ts#L8 might help we can't reuse streams with lightpush because each request is sent on one stream, and libp2p will close stream after a response is receieved. @x48115 pls let us know if that helps. happy to keep this open until satisfaction is obtained. |
To add on that, I have tried in the past to re-use the same stream on req-resp protocols such as store but libp2p closes the stream once the response is received. Maybe it's something that changed. Also note that if you send several messages on the outbound stream with light push, you will expect several responses (for the ack). The whole point of being able to create several stream is this exact multiplexing need AFAIK. As mentioned above, you should be able to pass libp2p options to |
Moving to Triage to discuss any potential work which might include graceful handling of sending multiple requests at once. |
Let's check:
Additional action point: if increase to outbound streams influence it anyhow. This issue does not improve |
Problem
When attempting to send many messages back to back we run into an error:
ERR_TOO_MANY_OUTBOUND_PROTOCOL_STREAMS
Steps to reproduce
Expected Results
Expected to be able to send many messages back to back with no error (I can do this with libp2p directly with both floodsub and gossipsub implementations
Actual results
Libp2p example with no issues
Note
This is mentioned in a couple places:
ChainSafe/js-libp2p-gossipsub#306
ChainSafe/js-libp2p-gossipsub#293
Suggested fix
Currently
lightPush.send
makes a new stream for every method. In the comments in the two issues above it seems js-libp2p's expectation is that a protocol should only have one open stream and send all messages over that stream instead of opening a new stream per message.js-waku/packages/core/src/lib/light_push/index.ts
Line 49 in 89392db
The text was updated successfully, but these errors were encountered: