How many system resources will be held for keeping 1,000,000 websocket open? [closed]

On today’s systems, handling 1 million concurrent TCP connections is not an issue.

I can affirm that based on our own tests (full disclosure: I am the CTO at Lightstreamer).

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). But let me recap the configuration where we tested 500K concurrent connections, as this is a much more recent test performed on Amazon EC2.

We installed Lightstreamer Server (which is a WebSocket server, among other things) on a m2.4xlarge instance. This means 8 cores and 68.4 GiB memory.

We launched 11 client machines to create 500,000 concurrent connections to the Lightstreamer Server. The test was configured so that the total outbound throughput from the server was 90,000 updates/s, resulting in peaks of 450 Mbit/s outbound bandwidth.

The server never used more than 13 GiB of RAM and the CPU was stable around 60%.

With at least 30 GiB RAM you can handle 1 million concurrent sockets. The CPU needed depends on the data throughput you need.

Leave a Comment