有多少用户 Nodejs &Socket.io可以支持吗? [英] How many users Nodejs & Socket.io can support?

查看:23
本文介绍了有多少用户 Nodejs &Socket.io可以支持吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个实现了broadcast.emit 的网站.向网站的所有用户发送消息.它只是 socket.io 的最简单实现,但我目前遇到了问题.当我达到大约 100 个并发用户时.nodejs 服务器开始滞后,直到它挂起,我无法再访问我的整个网站.当我们检查服务器时.nodejs 占用了 100% 的 CPU.正常吗?

I got a website that implements the broadcast.emit. that sends message to all users of the site. It is just the simplest implementation of socket.io but I currently having a problem. When I hit about 100 concurrent users. The nodejs server starts to lag until it hangs that I can no longer access my whole website. When we checked the server. The nodejs is taking 100% of the CPU. Is it normal?

我想知道 socket.io 可以支持多少用户?当这件事发生时,有没有办法以编程方式重新启动 nodejs 服务器?

I was wondering how many users can socket.io supports? And when this thing happen is there a way to restart the nodejs server programatically?

推荐答案

至少 250k 个并发连接(对于大多数用例瓶颈是内存)

At least 250k concurrent connections (and for most use cases bottleneck is memory)

这篇关于有多少用户 Nodejs &Socket.io可以支持吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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