Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring auto scaling with multiple target groups

Is it a good practice to setup 1 autoscaling with multiple target groups. All the target groups registered with same load balancer.

The scenario is Application load balancer LB1 listens on 80 and 443, has the target groups:

"open" Port is http/80

"secure". Port is https/443

If the auto scaling group has target tracking policy on average CPU utilisation, if "open" target group has higher CPU utilisation than "secure". Then there would be no auto scaling?

If alarm is breached how auto scaling group determine which target group should have the new instance?

Do I have to create separate auto scaling. group for each target group. I could not find any amazon docs for this scenario of multiple target group under 1 auto scaling group.

Please let me know

like image 730
prassank Avatar asked Mar 05 '26 10:03

prassank


1 Answers

According to the AWS Documentation

If you attach multiple load balancer target groups or Classic Load Balancers to the group, all of them must report that the instance is healthy in order for it to consider the instance healthy. If any one of them reports an instance as unhealthy, the Auto Scaling group replaces the instance, even if other ones report it as healthy.

My test confirms that behavior with the one exception. Usually people start to configure auto-scaling group with the default settings, which means that the health-check is set to EC2 by default. For the proper work of multiply target groups attached to one auto-scaling group the health check should be set to ELB. If you change it after ASG started up, existing instances are not obey this new setting and retain in the groups.

It may cause the incorrect conclusion like this:

I have tried it, The instances retained even if its marked un healfthy from one target group @prassank

So the answer is:

It is not a good way to attach multiply target groups to a singe auto-scaling group unless you want more strict multiply health checking.

like image 179
Roman Shishkin Avatar answered Mar 08 '26 03:03

Roman Shishkin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!