0

So we have a server application which communicates with clients through websocket and we need to regularly upgrade our server app binary. We may have multiple server instances, I know that I can offline the instance I'm upgrading but you know since websocket is long-lived tcp connections so the instance still holds some existing connections with the client, we don't want these existing connections disconnect.

I have known that I can do some work in our server application implementation to delegate the existing connections to a sub-process. But I'm wondering now if I could use AWS ELB to mitigate this issue.

I'm not quite sure how ALB/NLB works exactly, but I'm thinking since ALB/NLB is hiding servers from clients, it's the ALB/NLB holds the connections with clients. Then during server upgrades, could ALB/NLB migrate the existing connections related to the upgrading instance to the ones that has already finished upgrading?

Say we have two server instances A and B, the procedure would looks like:

  1. take off A from the ALB/NLB
  2. new connections from the clients will only forwards to B
  3. ALB/NLB migrates the existing connections with A to B
  4. A finished upgrading, put A onto the ALB/NLB
  5. new connections from the clients forwards to A again
  6. repeat the procedure on B

During the whole process, the client is unaware what happens on the cloud.

Does ALB/NLB support the stuff like this?

1 Answer 1

0

Unfortunately, no LB offered by AWS has this ability of migrating live connections from an upstream to another. You need to have a high time of draining and roll connections slowly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .