17 Scaling up and down: auto-scaling and CloudWatch

 

This chapter covers

  • Creating an auto-scaling group with launch template
  • Using auto-scaling to change the number of virtual machines
  • Scaling a synchronous decoupled app behind a load balancer (ALB)
  • Scaling an asynchronous decoupled app using a queue (SQS)

Suppose you’re organizing a party to celebrate your birthday. How much food and drink do you need to buy? Calculating the right numbers for your shopping list is difficult:

  • How many people will attend? You received several confirmations, but some guests will cancel at short notice or show up without letting you know in advance. So the number of guests is vague.
  • How much will your guests eat and drink? Will it be a hot day, with everybody drinking a lot? Will your guests be hungry? You need to guess the demand for food and drink based on experiences from previous parties as well as weather, time of day, and other variables.

Solving the equation is a challenge because there are many unknowns. Behaving as a good host, you’ll order more food and drink than needed so no guest will be hungry or thirsty for long. It may cost you more money than necessary, and you may end up wasting some of it, but this possible waste is the risk you must take to ensure you have enough for unexpected guests and circumstanmces.

17.1 Managing a dynamic EC2 instance pool

 
 
 
 

17.2 Using metrics or schedules to trigger scaling

 
 
 
 

17.2.1 Scaling based on a schedule

 
 

17.2.2 Scaling based on CloudWatch metrics

 
 
 

17.3 Decouple your dynamic EC2 instance pool

 

17.3.1 Scaling a dynamic EC2 instance pool synchronously decoupled by a load balancer

 
 

17.3.2 Scaling a dynamic EC2 instances pool asynchronously decoupled by a queue

 
 
 
 

17.4 Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest