AWS Certified Advanced Networking Specialty · Free Practice Question Medium
Question 6
An Elastic Load Balancer (ELB) is configured with an Auto Scaling Group (ASG) having a minimum of 4, a maximum of 10, and a desired value of 4 instances. The ASG cooldown and the termination policies are configured to the default values. Monitoring reports indicate a general usage requirement of 4 instances, while any traffic spikes result in an additional 7-8 instances. Customers have been complaining of request timeouts and partially loaded pages.
Which configuration change will you suggest as the first line of troubleshooting to fix this issue?
-
A
Add a lifecycle hook on scale-out event to your ASG, making sure that the instance is fully ready before it starts receiving traffic
-
B
Configure termination policies on ASG to determine which instances it terminates first during scale-in events
-
C
Configure connection draining on ELB
-
D
Enable Sticky Sessions on ELB
Reveal correct answer
Correct answer: C
Explanation
Correct option:
Configure connection draining on ELB - To ensure that an ELB stops sending requests to instances that are de-registering or unhealthy while keeping the existing connections open, use connection draining. This enables the load balancer to complete in-flight requests made to instances that are de-registering or unhealthy.
When you enable connection draining, you can specify a maximum time for the load balancer to keep connections alive before reporting the instance as de-registered. The maximum timeout value can be set between 1 and 3,600 seconds (the default is 300 seconds). When the maximum time limit is reached, the load balancer forcibly closes connections to the de-registering instance.
When Connection Draining is enabled and configured, the process of deregistering an instance from an Elastic Load Balancer gains an additional step. For the duration of the configured timeout, the load balancer will allow existing, in-flight requests made to an instance to complete, but it will not send any new requests to the instance.
Incorrect options:
Configure termination policies on ASG to determine which instances it terminates first during scale-in events - Amazon EC2 Auto Scaling uses termination policies to determine which instances it terminates first during scale-in events. Termination policies define the termination criteria that is used by Amazon EC2 Auto Scaling when choosing which instances to terminate. However, termination policies are not relevant to the given use case.
Enable Sticky Sessions on ELB - Sticky session feature (also known as session affinity), enables the load balancer to bind a user's session to a specific instance. This ensures that all requests from the user during the session are sent to the same instance. The key to managing sticky sessions is to determine how long your load balancer should consistently route the user's request to the same instance. A sticky session is relevant for a use case that needs to maintain session functionality.
Add a lifecycle hook on scale-out event to your ASG, making sure that the instance is fully ready before it starts receiving traffic - Amazon EC2 Auto Scaling offers the ability to add lifecycle hooks to your Auto Scaling groups. These hooks enable an Auto Scaling group to be aware of events in the Auto Scaling instance lifecycle and then perform a custom action when the corresponding lifecycle event occurs. Adding a lifecycle hook on a scale-out event is not relevant for the given use case.
References:
https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html
https://aws.amazon.com/blogs/aws/elb-connection-draining-remove-instances-from-service-with-care/
https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html
https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
