2

Regarding to AWS official documentation: https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html during the scale-in process an instance initially goes into Terminating:Wait state before it will be eventually terminated. While an instance is in that "pause" state we are able to do some work like downloading logs etc.

I am very curious about open web-socket connections. When instance is an Terminating:Wait state it cannot accept requests for any new connections and it is ok.

But what about existing connections? Are they still alive and able to work until the instance is fully terminated?

Links to an official sources will be appreciated.

Aslan
  • 21
  • 5

1 Answers1

0

How are the websocket connections being formed? If its through an ELB then they would be killed before the terminate:wait state starts. The first thing that happens during any termination workflow is to deregister the instance from its associated CLBs and target groups[1]. After that completely finishes, then the terminate:wait state and lifecycle hook will start

[1] https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html

Shahad
  • 771
  • 4
  • 6