Autoscale Classic Load Balancer on TCP connections - client holding connection till it terminates

0

I have Classic Load Balancer to load balance TCP communication. For example I have two instances of TCP server (service) behind classic load balancer.

Client application let say 10 instances - request for a connection and every instance will get connected to one out of two instances and we will start sending messages. Client application will keep the connection unless it is kicked out by server being idle or something similar.

If I now add two more instances behind that load balancer, will load balancer will kill existing connections so that 10 instances get connected to 4 instances instead of existing two? This is because clients are already connected and holding connections for more than one messages probably hours!

If this is not possible what is design pattern to autoscale TCP load balancing?

Thanks in Advance!

1 個回答
1

Hello,

Classic Load Balancer (CLB) hold two separate connections, front-end (client <> CLB) and Backend (CLB <> server). CLB will not terminate connections unless they reach the idle timeout (Ie, no data has been sent on the connection for X seconds). In other words, CLB will not forcefully terminate established and active connections to rebalance them because new backends has been added

When you add two more instances behind CLB, once they are registered and healthy, CLB will include these two new instances as part of its routing algorithm (round robin for TCP listener), for every new incoming connection, the request will land on any of the now 4 instances.

Note that cross-zone will also impact how your requests are distributed You can refer to https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/how-elastic-load-balancing-works.html for more detail.

AWS
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南