socket.io-chat-fargate icon indicating copy to clipboard operation
socket.io-chat-fargate copied to clipboard

Users online with multiple servers or containers ... works fine?

Open felipemarques opened this issue 5 years ago • 1 comments

In your code... the number of users conected on the socket, are calculated based in users connect on socket connection... this is correct ? Please tell me if i am wrong, but, in your code , when this project is deployed to a cluster with a load balancer... using sticky sessions, the total number of users conected, not working properly, right ?

The correct way, would be get the total number of users connected from dynamodb or redis, for example, no?

Thankyou! (sorry my bad english)

felipemarques avatar Aug 30 '18 18:08 felipemarques

Yes, @felipemarques you are right, take a look at this branch: https://github.com/nathanpeck/socket.io-chat-fargate/tree/4-scaling here, he used a lib called presence.js. It is used to get the total number of users connected from Redis.

jonigl avatar May 03 '19 18:05 jonigl