Question

I have some socket.io node.js servers running as amazon instances, when connecting directly to an instance, my socket.io application can connect and reconnect in a few milliseconds. However, when I direct the application through the load balancer, the application is a lot slower to connect and reconnect (taking 5+ seconds).

I have configured the load balancer to forward TCP port 80, as well as well the port that my node servers listen on (port 3000). Are there any other ports required by socket.io to function optimally? Or is my issue caused by something other than ports?

Thanks.

Was it helpful?

Solution

I've realised that this isn't to do with ports or anything like that. The amazon load balancer keeps the first reconnection attempt open until it times out, this means that the first connection waits 60 seconds before timing out or reconnecting. I have not been able to reduce the timeout on the ELB, this is a known issue on the AWS forums and has been for a few years now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top