4

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?

Community
  • 1
  • 1
Moshe Simantov
  • 3,937
  • 2
  • 25
  • 35
  • 1
    Sadly, the question seems too broad for this site, although it might fit [here](https://softwareengineering.stackexchange.com). On a practical note, the WebRTC is designed to be peer-to-peer and might require some extra overhead, so I would consider Websocket to have a better chance at higher performance (untested). – Myst Jul 24 '17 at 00:19
  • P.S. Another consideration might be the availability of clients. Websockets should be available on most (or all) machines, while WebRTC isn't. i.e., [WebRTC doesn't seem to be available for Safari web browsers](https://webrtc.org/web-apis/) while Firefox and Chrome have slightly different APIs. – Myst Jul 24 '17 at 00:23
  • @Myst when referring other sites, it is often helpful to point that [cross-posting is frowned upon](https://meta.stackexchange.com/tags/cross-posting/info) – gnat Jul 24 '17 at 06:08
  • @gant So I wonder about the performance of WebRTC at large scale. Where can I get that information? – Moshe Simantov Jul 24 '17 at 06:13
  • @gnat thanks for pointing this out - it's important and I always forget to mention this. – Myst Jul 24 '17 at 21:52

0 Answers0