Question 5: You have deployed an eLearning website called AcmeLearning.com which has more than million subscriber from various part of the world. You found that initially it was working fine and later on due to some internal caching issue, it was not working fine on some of the EC2 instances. To avoid any downtime with your servers hosting application you have added health checks of those EC2 instances which are part of auto-scaling group. You have found that all the instances in the auto-scaling group is shown as healthy instance. But in the logs you found that many of the instances hosting the application are not responding properly and users are getting error pages when hit on those instances. But scaling shows that all the instances part of the group are healthy. What could be an issue here?
- Configured health checks grace period is very low.
- You have to add lifecycle hook to the application.
- Process which inform Auto-scaling about the system status check is not working.
- Default health check process will not check the status of the application.
- Connection draining is not enabled.
Correct Answer : D
Detailed Explaination: In summary we can say that there are many instances which are not responding properly to the user requests. Because of some caching issue. You can see in auto-scaling that all the instance status is healthy.
So whenever there is a bug in your application auto-scaling health checkup will not check the health status of your application. Health check status will check only if the instance has some issue on which the application installed. So option-4 is correct.
If we see remaining option
Option-1: Grace period should be enough and will be helpful when you need enough time period for instance to warm-up and you can increase it if your application take longer time to launch. But again it does not help if your application is down. As soon as grace period expire it will check health status of instance and not for application. And if instance health status is fine it will report instance as healthy.
Option-2: Adding lifecycle hook will not help in monitoring application health.
Option-3: Process which checks the health status is not in user control that is managed by the AWS itself.
Option-5: Connection draining is an option to serve the all the pending request from that instance before replacing the instance. It can be configured with the time as well. So it cannot be an answer.
You can do custom health checks for each EC2 instance, so in custom health checks you will check your application status your own. And if you find that application status is not good then mark that EC2 instance unhealthy, so Auto-scaling will replace that instance.