max-mapper / websocket-stream

websockets with the node stream API
BSD 2-Clause "Simplified" License
667 stars 114 forks source link

[Question] Impact of Latency on websocket streams #136

Open binarykitchen opened 6 years ago

binarykitchen commented 6 years ago

Wondering if there is any prior research on latency here?

Considering moving the www.videomail.io server to another country which will increase latency for 90% of all my clients. Because www.videomail.io relies heavily on your websocket-stream code, I'd be better careful here. How badly will more latency impact on websocket-stream's performance? Or can this be ignored since it affects initial page load only?

mcollina commented 6 years ago

There is very little here that impacts latency. However, websocket suffers from the problem you are describing.

I will recommend to deploy a videomail on multiple servers throughout the world to avoid any latency problem.

binarykitchen commented 6 years ago

Well I meant the other way around. How will a higher latency like 30 more milliseconds impact websocket stream performance?

For example during initialisation only until stream emits the first data event. Or will it also slow down every single frame which goes through the pipe?

mcollina commented 6 years ago

There is no prior research for that. However, I do not expect any difference from a TCP socket.

binarykitchen commented 6 years ago

Really no research? Should I better as on the ws repo https://github.com/websockets/ws ?

And do you know by coincidence how latency impacts a TCP socket in short?

mcollina commented 6 years ago

There is no research done in the impact of this module on latency. On websocket there is plenty, I would recommend to google around.