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

WebSocket backpressure #109

Open
tomaka opened this issue Feb 9, 2023 · 2 comments
Open

WebSocket backpressure #109

tomaka opened this issue Feb 9, 2023 · 2 comments
Labels
blocked Progress on this issue requires something beyond our control

Comments

@tomaka
Copy link
Contributor

tomaka commented Feb 9, 2023

paritytech/smoldot#1089

@tomaka tomaka added the blocked Progress on this issue requires something beyond our control label Feb 10, 2023
@tomaka
Copy link
Contributor Author

tomaka commented Mar 17, 2023

Re-explaining the problem here:

While the WebSocket and WebRTC protocols have back-pressure mechanism, the browser doesn't provide any way to use them. If the remote sends for example 2 gigabytes of data, the browser will happily repeatedly call the onmessage callback with packets whose total size amounts to 2 GiB. And the receiver, when it can't process the packets immediately because it's busy with other things, has no other solution but to buffer the packets, which could make the program run out of memory.

cc w3c/webrtc-nv-use-cases#44 for the WebRTC situation.

@tomaka
Copy link
Contributor Author

tomaka commented Mar 17, 2023

In the long term, the plan is to deprecate the WebSocket protocol, and hope that browsers allow access to WebRTC back-pressure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Progress on this issue requires something beyond our control
Projects
None yet
Development

No branches or pull requests

1 participant