Socket.io:WebSockets 可以处理多少个并发连接? [英] Socket.io: How many concurrent connections can WebSockets handle?

查看:38
本文介绍了Socket.io:WebSockets 可以处理多少个并发连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道您是否有关于与 websockets 的并发连接的任何数据?我在 Node.js 服务器上使用 Socket.io.有多少客户端可以连接到套接字并接收数据而不会关闭我的服务器?1000?1000.0000?

I am wondering if you have any data on concurrent connections to websockets? I am using Socket.io on Node.js server. How many clients can connect to socket and receive data without bringing my server down? 1000? 1000.0000?

谢谢!

推荐答案

这在很大程度上取决于您的硬件配置、您在服务器端到底在做什么/处理什么以及您的系统是否针对许多并发连接进行了优化.例如,默认情况下在 Linux 机器上,您可能会首先达到最大打开文件数或其他限制(可以是 增加),然后再遇到硬件资源耗尽或类似的可扩展性问题.关键资源可能是您的 node.js 程序可以分配的 RAM 量,以保持并发连接的打开和接收新连接的能力.

This highly depends on your hardware configuration, what exactly are you doing/processing on the server side and if your system is optimized for many concurrent connections. For example on Linux machine by default you would probably first hit maximum number of opened files or other limits (which can be increased) before running into hardware resources exhaustion or similar scalability issues. Key resource may be the amount of RAM which can be allocated by your node.js program to keep concurrent connections opened and ability to receive new ones.

这篇关于Socket.io:WebSockets 可以处理多少个并发连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆