Best crate for large number of parallel websocket connections

I am working on a websocket client tool which has to establish thousands of parallel connections with the server. I have implemented that using tokio websockets with native TLS. It works fine up to 100 connections, but when I try to run it to establish 1000 connections, I get a lot of failures. It appears to be very slow even with multi_thread configuration. It tries to do a TCP handshake for all 1000 connections and really goes for TLS handshake after a long time causing server to drop the connection. The tool doesn't perform any activity other than the standard stuff establish a secure websocket connection.

Please suggest a good websocket crate which can support large number of secure websocket connections in parallel.

tungstenite is the highest ranked crate in' WebSocket category, maybe give it a try? There's also the tokio-tungstenite crate that integrates the aforementioned tungstenite with tokio.

I will try that. Thanks for the suggestion!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.