I saw this question about WebSocket performance. The conclusion of this question was that:
On today's systems, handling 1 million concurrent TCP connections is not an issue.
We had to demonstrate several times, to some of our customers, that 1 million connections can be reached on a single box (and not necessarily a super-monster machine)
With at least 30 GiB RAM you can handle 1 million concurrent sockets. The CPU needed depends on the data throughput you need.
I need to build a service that can connect to multiple peers at large scale. The traffic should be very minimal and mostly passing a small messages between the server and the client on real-time. It could be that some connections will be idle for a long time.
I wonder which protocol will give me better performance with less resources on those circumstances. I need to choose a protocol that has real-time capabilities, but also supported on web-browsers so I ended up with WebSockets and WebRTC (On WebRTC, the server will establish a WebRTC DataChannel
to each peer via some signaling service).
What's the performance of WebRTC at large scale comparing to TCP sockets? Can it handle large amount of connection with less resources than TCP sockets?