A company runs a high-traffic web application on Amazon EC2 instances managed by an Auto Scaling group (ASG) behind an Application Load Balancer (ALB). The application handles long-lived WebSocket connections and standard HTTP requests. During scale-in events, users complain that their active WebSocket sessions are abruptly terminated. Additionally, during sudden traffic surges, the ASG fails to scale out quickly enough because the default scaling metric (average CPU utilization) does not immediately reflect the sudden increase in connection volume. Which two actions should the solutions architect take to resolve these issues? (Select two.)
- Increase the deregistration delay (connection draining) timeout value for the Application Load Balancer target group to allow active connections to persist during scale-in.Cevap
- Configure a target tracking scaling policy for the Auto Scaling group using the Application Load Balancer request count per target metric.Cevap
- CAdjust the Application Load Balancer target group health check configuration to use port 80 instead of the custom application port to match the listener port.
- DModify the security groups associated with the EC2 instances to allow outbound ephemeral port traffic to the load balancer, ensuring return traffic is not blocked.
- EConfigure an Amazon Route 53 latency routing policy pointing directly to the individual EC2 instances to distribute connection volume based on client proximity.
Cevap
The correct actions are to increase the deregistration delay timeout for the target group and to configure a target tracking scaling policy for the Auto Scaling group using the Application Load Balancer request count per target metric.
To prevent active WebSocket connections from being terminated abruptly when an EC2 instance is being decommissioned during scale-in, the deregistration delay (connection draining) timeout on the target group should be increased. This allows the load balancer to keep existing connections open until they complete or the timeout expires. To address the slow scaling issue, using the Application Load Balancer request count per target metric in a target tracking policy provides a direct, immediate indicator of request volume changes, allowing the Auto Scaling group to scale out faster than it would when relying solely on CPU utilization metrics, which have a delayed response to sudden network spikes.
Adım Adım Çözüm
Anahtar Kavram
Graceful connection management via ELB connection draining and rapid scaling using load balancer metrics.