How can I scale socket.io?

后端 未结 2 709
栀梦
栀梦 2020-12-13 09:47

Let\'s say a server gets 10,000 concurrent connections (via socket.io). That\'s a lot, and if it can\'t handle any more, I need to spin up another server.

How can I

2条回答
  •  -上瘾入骨i
    2020-12-13 10:35

    You can try to use for example cluster module and distribute the load to multiple cores (in case you have a multi-core CPU). In case this is not enough you can try to use reverse proxy for distributing requests across multiple servers and redis as a central session data store (if it's possible for your scenario).

提交回复
热议问题