WebSockets and load balancing bottleneck?

With a group of systems that act as WebSocket and Load Balancers in front of these unmanned aerial vehicles. When the WebSocket request enters the LB, it selects the WebSocket beep and the WebSocket is installed. (I am using AWS ELB tcp SSL-terminated on ELB)

Question: Now does the created WebSocket go through the LB, or does the LB redirect the WebSocket request to the WebSocket beep, and therefore there is a direct connection between the client and the WebSocket hum?

If the WebSocket connection passes through the LB, this will make the LB a huge bottleneck.

Removing LB and passing clients the direct IP address of the WebSocket beep, you can get around this bottleneck, but this logic itself, which I plan to do, requires (depending on the answers to these questions).

So my thoughts on how this works correctly?

+7
amazon-elb websocket load-balancing
source share
1 answer

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 ..

+3
source share

All Articles