AWS ELB as LB
After looking at a possible duplicate suggested by Pavel K , I conclude that the WebSocket connection will go through AWS ELB, as in:
Browser <--WebSocket--> LB <--WebSocket--> WebSocketServer
This makes ELB the bottleneck I would like:
Browser <--WebSocket--> WebSocketServer
If ELB is used only to give the client the host name / IP of the available WebSocketServer.
DNS as LB
The above problem can be circumvented by balancing at the DNS level, as described in a possible duplicate . Thus, DNS will provide the IP of an accessible WebSocketServer when ws.myapp.com is requested.
Downside is that this will require a constant DNS update with WebSocketServer changes up / down (if your application is resilient, this becomes an even bigger problem).
Custom lb
Another possibility would be to create a custom LB that constantly monitors WebSocketServers and returns the IP of the available WebSocketServer when the client requests it.
Downside is that the client needs to perform a separate (AJAX) request to obtain the IP address of the available WebSocketServer, while with AWS ELB, load balancing is implicit.
Conclusion
Choosing the best evil ..
xrDDDD
source share