Scaling Compute: Elastic Load Balancing and Auto Scaling Flashcards
Design required for highly available and secure
website on EC2 with ALB, and DB on EC2
Launch ALB in public subnets, web servers in private subnets and DB layer in private subnets – all layers across AZs
HealthyHostCount metrics for an ALB have dropped from 6 to 2. Need to determine the cause
The health checks on target EC2 instances are failing
An instance attached to an ALB exceeded
the UnhealthyThresholdCount for consecutive health check failures. What will happen?
Health checks will continue and the ALB will take the instance out of service
Requirement to track the source IP of clients and the instance that processes the request
Check the ALB access logs for this information
Requirement to trigger an alarm when all instances are unhealthy
Use Amazon CloudWatch with the condition:
“AWS/ApplicationELB HealthyHostCount <= 0”
Need to check why users cannot connect to web server public IP and port (behind ALB)
Check the VPC Flow Logs
HTTPCode_ELB_5XX_Count Amazon CloudWatch metrics are noticed for an ALB
The target group may not contain any healthy
instances
CloudWatch shows 4XX errors for app with ALB but the Instances have already been terminated and need to analyze the root cause
Use ELB access logs to retrieve info from S3 bucket to find the originators of the requests
Need a load balancer where specific static public IP addresses can be whitelisted by clients
Use a Network Load Balancer (NLB)
Poor performance has been experienced for an application running on Amazon EC2
Use EC2 Auto Scaling to dynamically scale
503 and 504 errors experienced and instances have high CPU utilization
Use EC2 Auto Scaling to dynamically scale
ASG does not launch instances during busy periods despite max capacity not being reached
Could be due to service limits (check Trusted Advisor) or check for RunInstances requests in CloudTrail in case they are failing
Need to analyze instances before they are terminated
Use Auto Scaling lifecycle hooks to pause termination
Auto Scaling scales based on queue depth but at beginning of day app slows down
Create a scheduled scaling policy
Create highly available EC2 Auto Scaling group for a single instance app
Use at least 3 AZs, min size of 2, desired capacity of 2, and max of 2