DOP-C02 Question 396
Select 3Your organization is using an Auto Scaling group (ASG) with Amazon EC2 instances behind an Application Load Balancer (ALB) to host a web application. Recently, during high traffic periods, you noticed that the application experiences increased latency and some requests fail intermittently. After investigation, it was found that the issue originates from slow application startup times on new instances launched by the ASG. As a DevOps Engineer, what approach should you implement to mitigate this issue while minimizing user impact?
- A
Increase the cooldown period for the Auto Scaling group to allow instances more time to stabilize.
- B
Implement a lifecycle hook to perform application initialization tasks before the instance is added to the ALB.
- C
Configure the ALB to perform health checks on the application and only route traffic to healthy instances.
- D
Pre-warm the application by running startup scripts that simulate traffic during instance initialization.
- E
Modify the Auto Scaling group to launch instances with pre-built Amazon Machine Images (AMIs) that have the application pre-installed and configured.
Show answer and explanation
Correct answers: B, C, E
Explanation
To mitigate the issue of slow application startup times, multiple strategies can be combined: lifecycle hooks can ensure initialization tasks complete before routing traffic, ALB health checks can ensure traffic is only sent to ready instances, and pre-built AMIs can drastically reduce startup times by including pre-configured application environments. These solutions collectively minimize user impact during scaling events and ensure a seamless experience during high traffic periods.
- A. Incorrect.
Increasing the cooldown period may delay scaling operations unnecessarily and does not address the root cause of the problem, which is slow application startup.
- B. Correct.
Using a lifecycle hook allows you to perform initialization tasks or complete application bootstrapping before the instance starts receiving traffic. This helps mitigate user impact caused by slow startup times.
- C. Correct.
Health checks ensure that only fully operational instances receive traffic. This prevents users from being routed to instances that are not ready to serve requests.
- D. Incorrect.
Pre-warming the application is a manual and error-prone process that does not scale well. It is not a recommended solution for automating instance readiness.
- E. Correct.
Using pre-built AMIs with the application pre-installed significantly reduces startup time for new instances, addressing the root cause of the problem effectively.