This course was recorded and produced by Total Seminars. We're pleased to host this training in our library.
Skill Level Intermediate
- One of the great benefits of cloud computing is the fact that everything is virtualized. What I mean by that is because we're dealing with virtual equipment, we can take advantage of the same things that we could do if for example we were running a large scale Hyper-V infrastructure in our company, or a large scale VMWare infrastructure in our company. Those virtualization platforms gave you dynamic scaling capabilities. And that's something that AWS gives to us as well. Now they call it "auto scaling." The ability to automatically scale out or scale in according to our needs at any given time. This is a great advantage over the old physical server infrastructures that we built in the years gone by. With a physical server infrastructure, if you want to scale up it means adding more physical servers. If you want to scale in it means, oh wait we never did that with physical hardware because once you bought it it was yours whether you needed it or not and it was just wasted money if you bought it and didn't actually need it. This is the beauty of auto scaling. What does auto scaling actually do? Well it monitors your applications and then adjusts capacity according to your needs. So it looks at what's actually going on in an instance, for example, and says you know what, the CPU utilization is really really high so I'm going to go ahead and give you another instance, so we can bring the utilization across the two instances down. And then if it gets really high again, I'm going to give you another instance so that the overall utilization on each instance goes down. In other words we keep adding instances as we need them. But then what happens if we've added the instances to where we now have four instances, and yet it's only 10% utilized on each instance? That means we don't need four anymore right? But we're paying for them according to costs in AWS. So what AWS does says I'm going to manage cost for you. I'm going to take that from four back to three or even two, or maybe even one. Get it back down to the scale you need based on the current workload. That's the beauty of auto scaling. It scales out when you need it, it scales in when you don't. So let's take a look at auto scaling functionality. Basically what we have is of course the service for auto scaling in AWS. And it allows us to even look through your existing applications and see what you can scale. So you may have deployments already of applications on EC2 instances and the auto scale service can look through all of those instances and tell you hey this is one that can be scaled, and this is another that can be scaled. And it can automatically scale those for you. You don't have to start necessarily with auto scaling enabled. You just use auto scaling to find the things that can indeed be scaled. And that's what we're looking at here. Discover what you can scale, then choose what you want to optimize. Do you want to optimize performance? Or do you want to optimize cost? What is it that you're really focused on optimizing? And finally, track scaling as it happens. See exactly what scaling is doing for you. The big question we have to ask then is exactly what resources can be auto scaled in AWS? And there's several that can. First of all you have EC2 auto scaling groups. So you can create an auto scaling group which is a collection of EC2 instances that can be scaled. Aurora DB clusters can be scaled if you're using that database, or DynamoDB global secondary indexes or tables. They can both be scaled. The Elastic Container Service can be scaled as well. Remember we learned that that's for deploying docker containers. And Spot Fleet requests can be scaled. So all of these things really come down to different kinds of instances that can actually be scaled within AWS. So if you want to use auto scaling you have to have the right instances to do it. It is very important to know that auto scaling is free to use, but the results of its use may cost you. And the reason is it's free to enable auto scaling groups and have instances that can be scaled out, but if it is indeed scaled out it means it does add more instances, and more instances cost you money. It means that it will enable CloudWatch, and then CloudWatch is going to cost you to utilize. It may implement ELB load balancing and that's going to cost you as well. So auto scaling does it for you but you need to realize that what it does for you may increase your cost. But that's okay. Because remember, if we're scaling out we're scaling out because we need it. We're scaling out because the demand is higher than we thought we were going to need, or that we needed at the time of implementation. And now we do need to scale out. So it's okay that it costs more because we're using more. If we're using more it means we need more. If we need more it means there's cost justification for it. Generally speaking. So this is how auto scaling works. But it is important to keep in mind that you can manage costs. You can limit the total amount you're willing to spend per hour within your auto scaling group. So this way you can control that and say, well we can auto scale but only up to x amount of dollars per hour. So this gives you a summary of what auto scaling is really about. Helps you to understand the basic concept. Throughout this chapter we'll be focusing a lot more on auto scaling to understand exactly what we can do with it in the different areas of configuration, auto scaling groups, things like that. So we can effectively plan a good auto scaling deployment within AWS.