M
M
m5xim2016-07-31 19:16:09
Node.js
m5xim, 2016-07-31 19:16:09

10k websocket connections, do you need clusters?

Hello. A project is planned on node js, a pure websocket will be used without wrappers on the client and server sides. (The server will not give statics, it will not deal with anything other than working with ws and the database).
With the usual approach, without clusters, can the server withstand the load of 10k connections?
Assuming that clients will be with variable activity, i.e. some time packets go every second (for example, typing-keystrokes), some time idle.
Of course, the server configuration also matters, but if for example we take a normal server, with 16gb of RAM, Intel Core i7, will there be any slowdowns at peak load? Speed ​​is important.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2016-07-31
@m5xim

loading in 10k connections the server?

10K connections create almost no load. It's just connections and they just hang. Now, if we evaluate the approximate amount of data, etc. which will pass between the client and the server per second ... and in general what will happen with this data .... In general, for a 100% answer to your question, they came up with such a type of testing as load testing. If you have such strict non-functional requirements, it's easier to spend an evening and write at least a primitive load test and find out in practice.
Horizontal scaling should be set (at least minimally so that you can quickly correct it later).

A
Alexander Aksentiev, 2016-07-31
@Sanasol

First, find out that the node works in one thread, so at least intel i10, it will not be better from this.
Given what you're asking, you probably don't have much experience.
So you will have a harsh nodejs server that will devour memory with a shovel and withstand at best a couple of thousand connections on one worker, if it’s not completely bad to code.
So without a cluster, you don’t even need to start, but write with the expectation of using several parallel processes.
However, on the other hand, you are unlikely to have / will have such a load at all, so you can try without a cluster. There is no point in wasting energy on a cluster if you end up with a couple of hundred connections.
Therefore, for a start, you can try to drive on one process. And if SUDDENLY there will be such a load, then it will be possible to rewrite it to "finish".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question