Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket IO Endless Connection and Disconnection when using AWS Load Balancer with 2 Nodes(Task) #1517

Open
jessebithealth opened this issue Feb 12, 2025 · 2 comments

Comments

@jessebithealth
Copy link

I've been using Socket.io version 16.1.1, and normally, it works fine with AWS Load Balancer with only 1 node.
My team then tried to up the spec to 2 nodes, and now the iOS side is experiencing an endless connect-disconnect loop, as if the connection won't stick. (note: URL is wss)
Below is the socket config:
socketManager = SocketManager(socketURL: url, config: [ .log(true), .connectParams(params), .path("/caregiver-ws/"), .reconnects(true), .forceNew(true) ])
*i tried with forceWebsocket(true), but the weird part is, with forceWebsocket(true), the socket would not even connect, and is in a loop of reconnection
**the android client works fine, so I'm stuck
Any respond or help would be appreciated, thank you!

@ex3ndr
Copy link

ex3ndr commented Feb 27, 2025

Hit the very same problem! It was working fine until i scaled replicas in my k8s + alb on AWS

@jessebithealth
Copy link
Author

Hi, it was resolved on my end by hitting up my team that is responsible for the AWS setup. We used ALB and NLB at first, and ended up only using ALB only. Then, we set up stickiness for the ALB, and it solved my issue when scaling up to multiple nodes.
The socket manager setup is unchanged on my end.
Hopefully this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants