Course menuCLF-C02

Exams / CLF-C02 / Study guide / Auto scaling and load balancing

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.

Last verified against current AWS documentation ·How we write our questions

What to know for the exam

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.

  • 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.

Try the 2 practice questions

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.

  1. A. Application Load Balancer, which routes HTTP and HTTPS requests at layer 7
  2. B. Gateway Load Balancer, which distributes traffic to third-party virtual appliances
  3. C. Network Load Balancer, which works at layer 4 with static IP addresses
  4. D. 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.
  • C. Right: Correct. A Network Load Balancer works at layer 4, supports TCP and UDP, and gives each enabled Availability Zone a static IP address that partners can allow-list. Learn more: What is a Network Load Balancer? (opens in a new tab)
  • D. Wrong: Global Accelerator provides static IP addresses, which fixes the allow-list need. The Application Load Balancer behind it still works at layer 7, so the layer 4 requirement is missed. Learn more: AWS Global Accelerator components (opens in a new tab)

Explanation

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.

Study

A retailer's Auto Scaling group for its checkout servers has a minimum capacity of 3, a desired capacity of 6 and a maximum capacity of 12.

Overnight, traffic falls to almost zero, and the scaling policies reduce the group.

What is the smallest number of instances the group can run?

Choose one answer.

  1. A. 0, because Auto Scaling removes every instance when traffic is near zero
  2. B. 3, because scaling policies cannot reduce desired capacity below the minimum
  3. C. 6, because the group always keeps its original desired capacity
  4. D. 12, because the maximum keeps extra capacity ready for sudden peaks
Show the answer and explanation

Answer: B

  • A. Wrong: Zero is possible only if the minimum is set to 0. Here the minimum is 3, so the group can never drop below it.
  • B. Right: Correct. Scaling policies can change the desired capacity only within the minimum and maximum limits, so the group keeps at least 3 instances. Learn more: Amazon EC2 Auto Scaling group capacity limits (opens in a new tab)
  • 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.

Study

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

Study Auto scaling and load balancing

More Cloud Technology and Services topics