[英]Windows Server 2008, NodeJS, Socket.IO issue with number of clients
[英]How do I increase number of websocket clients in Nodejs Socket.io server deployed on AWS ECS fargate?
我正在使用 socket.io 在 AWS Fargate 中運行套接字服務器容器
800-1000 左右的連接用戶一切正常,但是當客戶端數量增加時,舊的套接字連接會自動斷開,並出現錯誤transport error
。
我的 AWS ECS 服務(Fargate 容器)在 AWS 應用程序負載均衡器后面運行。
需要應用任何特定配置來支持與我的容器的數千個並發連接嗎?
可以連接到單個套接字服務器的並發用戶數是否有限制?
AWS 任務定義有 4GB memory 和 2 個 CPU
套接字服務器代碼:
io = module.exports = require('socket.io')(server, {
'pingInterval': 10000,
'pingTimeout': 7000,
'origins': (env.APPLY_ALLOW_ORIGIN_FILTER) ? env.SOCKET_WHITELIST_URL : '*:*',
transports: ['websocket', 'htmlfile', 'xhr-polling', 'jsonp-polling', 'polling']
})
您可以嘗試的一件事是增加nofile
ulimit: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_limits 。
這控制了打開文件的最大數量,包括網絡 sockets。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.