If I am running a web service on EB that is accessible on lets say https://x.com, and my service opens websocket connections to another service, lets say wss://y.com, and I have persistent connections open to y.com, can my auto scaling group be scaled in (i.e. an instances getting terminated) if a connection is still open to y.com, even if it is serving requests below the scaling policy threshold.
- Have you managed to resolve this? If you are creating a web socket from the isntance, you can set it to LEADER instance, and only from that instance create a web socket connection. This LEADER would instruct EB not to destroy the instance ever.titus– titus2018-11-29 00:54:50 +00:00Commented Nov 29, 2018 at 0:54
2 Answers
The quick answer is no.
Amazon Auto Scaling Groups (ASG) will not know anything about connections that your instances have open with other servers, or any dependencies on those servers.
You ASG will scale based upon supported criteria that you define.
The long answer is that you could create software that manages your instances and then manages auto scaling yourself. This would not be an Amazon service, but your own private software.
[Old question, but there is an answer for this now]
The Active Connections metric is not considered a "simple target metric" for Auto Scaling Policy purposes, that is true. However, you can create a custom Alarm using the Application Load Balancer's Active Connection metric. You can then create an Auto Scaling Policy using the "Step Rule" type, and use the alarm as a trigger.