最大并发 Socket.IO 连接数 [英] Maximum concurrent Socket.IO connections

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

问题描述

这个问题以前有人问过,但最近没有问过,而且没有明确的答案.

This question has been asked previously but not recently and not with a clear answer.

使用Socket.io,在需要添加另一台服务器之前,是否有一个可以维护的最大并发连接数?

Using Socket.io, is there a maximum number of concurrent connections that one can maintain before you need to add another server?

有谁知道任何大规模使用 websockets(特别是 socket.io)的活跃生产环境?我真的很想知道哪种设置最适合最大连接数?

Does anyone know of any active production environments that are using websockets (particularly socket.io) on a massive scale? I'd really like to know what sort of setup is best for maximum connections?

因为 Websocket 建立在 TCP 之上,所以我的理解是除非在连接之间共享端口,否则您将受到 64K 端口限制的约束.但我也看到了使用 Gretty 的 512K 连接的报告.所以我不知道.

Because Websockets are built on top of TCP, my understanding is that unless ports are shared between connections you are going to be bound by the 64K port limit. But I've also seen reports of 512K connections using Gretty. So I don't know.

推荐答案

这篇文章可能对你有所帮助:http://drewww.github.io/socket.io-benchmarking/

This article may help you along the way: http://drewww.github.io/socket.io-benchmarking/

我想知道同样的问题,所以我最终编写了一个小测试(使用 XHR 轮询)来查看连接何时开始失败(或落后).我发现(就我而言)套接字在大约 1400-1800 个并发连接时开始起作用.

I wondered the same question, so I ended up writing a small test (using XHR-polling) to see when the connections started to fail (or fall behind). I found (in my case) that the sockets started acting up at around 1400-1800 concurrent connections.

这是我做的一个简短的要点,类似于我使用的测试:https://gist.github.com/jmyrland/5535279

This is a short gist I made, similar to the test I used: https://gist.github.com/jmyrland/5535279

这篇关于最大并发 Socket.IO 连接数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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