A financial services company hosts a report generation API on Amazon EC2 instances. The instances are managed by an Auto Scaling group (ASG) behind an Application Load Balancer (ALB). The report generation requests are computationally intensive and can take up to seconds to complete. To allow fast instance replacement during application deployments, a developer set the ALB target group's deregistration delay to seconds. However, during scale-in events, users report receiving HTTP 502 (Bad Gateway) errors for reports that were in progress.
Which modification should a solutions architect recommend to resolve these errors?
- AAdd a rule to the private subnet's Network ACL to allow inbound traffic on ephemeral ports (-) from the ALB, and reduce the ASG cooldown period to seconds.
- Increase the deregistration delay of the ALB target group to at least seconds.Cevap
- CConfigure the ALB target group health check to use a dedicated management port instead of the traffic port, and reduce the health check interval.
- DImplement an Amazon Route 53 latency-based routing policy to redirect active user sessions to a secondary region during scale-in events.
Cevap
Increase the deregistration delay of the ALB target group to at least seconds.
Increasing the deregistration delay (also known as connection draining) of the target group to match or exceed the maximum request processing time ( seconds) ensures that the Application Load Balancer allows in-flight requests to complete before the Auto Scaling group terminates the instance.
Adım Adım Çözüm
Anahtar Kavram
Deregistration delay (connection draining) ensures that a load balancer stops routing new requests to targets that are deregistering, but allows existing in-flight connections to complete before the target is fully terminated.