Auto scaling and load balancing: CLF-C02 study notes and practice questions
What to know about Auto scaling and load balancing for the CLF-C02 exam, from the Cloud Technology and Services domain (34% of the exam guide), then 2 free questions to test it. Part of the CLF-C02 study guide.
Scaling and load balancing questions are about matching capacity to demand and keeping an application available when instances fail.
Amazon EC2 Auto Scaling
An Auto Scaling group keeps a number of instances running between a minimum and maximum, aiming for a desired capacity.
It replaces unhealthy instances automatically.
Scaling policies add or remove instances based on demand, for example to keep average CPU near 50%. Scheduled scaling changes capacity at set times; predictive scaling forecasts regular patterns.
Spread the group across multiple Availability Zones for high availability.
Elastic Load Balancing
Load balancer
Works with
Use for
Application Load Balancer
HTTP and HTTPS (layer 7)
Web applications; routes by URL path or host name
Network Load Balancer
TCP and UDP (layer 4)
Very high performance and static IP addresses
Gateway Load Balancer
Third-party virtual appliances
Inserting firewalls or inspection appliances
A load balancer sends traffic only to healthy targets, across Availability Zones, and gives users one address.
How they work together
Users connect to the load balancer; the load balancer spreads requests across the instances in the Auto Scaling group; the group grows when demand rises and shrinks when it falls, and replaces any instance that fails a health check.
Related ideas
Vertical scaling (scaling up) means a bigger instance; horizontal scaling (scaling out) means more instances. The cloud favors horizontal scaling.
AWS Auto Scaling can also scale other resources, such as DynamoDB tables and ECS services.
Common traps
Auto Scaling for spreading traffic. That’s the load balancer’s job; Auto Scaling changes the number of instances.
ALB vs NLB. Web traffic and URL routing point to ALB; UDP or static IPs point to NLB.
A multiplayer game company handles TCP and UDP game traffic at millions of requests per second.
Players connect through static IP addresses that partner networks can allow-list, and the company needs its load balancer to work at layer 4.
Which load balancer should it use?
Choose one answer.
AA. Application Load Balancer, which routes HTTP and HTTPS requests at layer 7
BB. Gateway Load Balancer, which distributes traffic to third-party virtual appliances
CC. Network Load Balancer, which works at layer 4 with static IP addresses
DD. Application Load Balancer behind AWS Global Accelerator, for static IPs
Show the answer and explanation
Answer: C
A. Wrong: An Application Load Balancer works at layer 7 on HTTP and HTTPS requests. That does not meet the layer 4 requirement for raw game traffic.
B. Wrong: Gateway Load Balancer inserts third-party security or inspection appliances into the traffic path. It is not designed to balance game traffic across game servers.
A Network Load Balancer works at layer 4, supports TCP and UDP, and gives each enabled Availability Zone a static IP address. An Application Load Balancer works at layer 7, and placing it behind Global Accelerator adds static IPs but keeps the layer 7 limit. Gateway Load Balancer is for inserting third-party appliances into traffic.
C. Wrong: Desired capacity is the target the group works toward, and scaling policies can change it. It is not a floor, so the group can fall below 6.
D. Wrong: The maximum is a ceiling on group size. It does not set a minimum number of running instances.
Explanation
Minimum capacity is the lowest size the group can reach, and scaling policies cannot push desired capacity below it. Desired capacity is the target and can be lowered by scaling, and maximum capacity is only a ceiling. So the group keeps 3 instances overnight.
Want more on Auto scaling and load balancing? The 5 full-length practice sets have 10 more Auto scaling and load balancing questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →