node.js server with socket.io handling 50000 simultaneous clients

北城余情 提交于 2019-12-03 14:04:24

问题


We are developing a Javascript control which should be constantly connected to a server for receiving animation updates.

We are planning to host this stuff on an Amazon cloud.

The scenario is like this: server connects to activemq queue waiting for updates, for each update it broadcasts it to all connected clients.

Is it even possible to handle such load with node.js + socket.io? Will a single node.js server be able to handle such load? How to organize fast transport between different nodes if we will have to use more than one node?


回答1:


Will single node.js server be able to handle such load?.. How to organize fast transport between different nodes if we will have to use more than one node

You say that you are planning to host on Amazon. So first off, nothing should be scoped for a single server. Amazon machines will simply "disappear", you have to assume that you are going to use multiple computers.

...handling 50k simultaneous clients

So to start with, 50k connections for a single box is a very big number. Here's a very detailed blog post discussing "getting to 10k" with node.js+socket.io.

Here's a very telling quote:

it seemed as though 10,000 clients simply required more serialization than my server was able to handle.

So a key component to "getting to 50k" is going to be the amount of work required just pushing data over the wire.

How to organize fast transport between different nodes if we will have to use more than one node.

That blog post is the first of 3. When you're done the first, read the other two. That should point you in the right direction.



来源:https://stackoverflow.com/questions/14953076/node-js-server-with-socket-io-handling-50000-simultaneous-clients

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!