1 00:00:00,560 --> 00:00:02,830 ‫Okay, so we've seen how Auto Scaling Groups works 2 00:00:02,830 --> 00:00:05,380 ‫but let's have a look at the different Scaling Strategy 3 00:00:05,380 --> 00:00:06,950 ‫for your Auto Scaling Groups. 4 00:00:06,950 --> 00:00:09,380 ‫So the first one is to do Manual Scaling. 5 00:00:09,380 --> 00:00:11,140 ‫Which is when we update the size 6 00:00:11,140 --> 00:00:13,500 ‫of a Auto Scaling Group manually. 7 00:00:13,500 --> 00:00:14,530 ‫And this is when for example, 8 00:00:14,530 --> 00:00:16,840 ‫we changed the capacity from one to two, 9 00:00:16,840 --> 00:00:18,700 ‫or back from two to one. 10 00:00:18,700 --> 00:00:21,322 ‫Then we can define some Scaling Strategies such as 11 00:00:21,322 --> 00:00:23,810 ‫Dynamic Scaling to respond 12 00:00:23,810 --> 00:00:25,910 ‫to changing demands automatically. 13 00:00:25,910 --> 00:00:27,220 ‫So we have different type 14 00:00:27,220 --> 00:00:29,190 ‫of scaling policies within Dynamic Scaling, 15 00:00:29,190 --> 00:00:31,990 ‫we have the Simple and the Step Scaling 16 00:00:31,990 --> 00:00:32,930 ‫which is the idea is 17 00:00:32,930 --> 00:00:35,620 ‫that whenever a CloudWatch alarm is triggered for example, 18 00:00:35,620 --> 00:00:38,230 ‫you say whenever the average CPU utilization 19 00:00:38,230 --> 00:00:43,230 ‫of all my EC2 instance goes over 70% for five minutes, 20 00:00:43,230 --> 00:00:46,870 ‫then add two units to capacity to my ASG. 21 00:00:46,870 --> 00:00:48,978 ‫Or when another alarm for example, 22 00:00:48,978 --> 00:00:51,620 ‫say whenever the CPU utilization is less 23 00:00:51,620 --> 00:00:53,380 ‫than 30% for 10 minutes. 24 00:00:53,380 --> 00:00:56,210 ‫Then remove one unit of capacity in my ASG. 25 00:00:56,210 --> 00:00:57,910 ‫This would be Simple or Step Scaling 26 00:00:57,910 --> 00:00:59,940 ‫because we define the trigger, 27 00:00:59,940 --> 00:01:03,710 ‫and then we define how many units we add or remove. 28 00:01:03,710 --> 00:01:06,420 ‫Then we have Target Tracking Scaling, 29 00:01:06,420 --> 00:01:09,360 ‫which is a very easy way of defining a scaling policy. 30 00:01:09,360 --> 00:01:10,840 ‫The example is to say, 31 00:01:10,840 --> 00:01:13,440 ‫hey I want the average CPU utilization 32 00:01:13,440 --> 00:01:16,260 ‫of all the EC2 instances in my ASG 33 00:01:16,260 --> 00:01:18,440 ‫to stay at around 40% on average 34 00:01:18,440 --> 00:01:21,500 ‫and then the ASG will scale automatically 35 00:01:21,500 --> 00:01:25,030 ‫to make sure that you stay around that target of 40%. 36 00:01:25,030 --> 00:01:26,630 ‫And we have also Scheduled Scaling. 37 00:01:26,630 --> 00:01:27,910 ‫So this is when we know 38 00:01:27,910 --> 00:01:30,440 ‫that changes are going to happen ahead of time. 39 00:01:30,440 --> 00:01:34,510 ‫So we anticipate a scaling based on known users pattern. 40 00:01:34,510 --> 00:01:35,580 ‫And for example we're saying, 41 00:01:35,580 --> 00:01:38,160 ‫hey we know that's on Friday at 5:00 PM. 42 00:01:38,160 --> 00:01:41,360 ‫People are going to do sports betting maybe who knows, 43 00:01:41,360 --> 00:01:43,150 ‫before the soccer game, 44 00:01:43,150 --> 00:01:45,500 ‫and so please increase the minimum capacity 45 00:01:45,500 --> 00:01:48,070 ‫to 10 EC2 instances in my ASG 46 00:01:48,070 --> 00:01:49,780 ‫at 5pm on Friday. 47 00:01:49,780 --> 00:01:52,390 ‫This could be a Scheduled Scaling 48 00:01:52,390 --> 00:01:53,790 ‫and there's one last type of scaling. 49 00:01:53,790 --> 00:01:55,900 ‫that is definitely appearing on the exam 50 00:01:55,900 --> 00:01:57,750 ‫which is called Predictive Scaling. 51 00:01:57,750 --> 00:01:59,170 ‫So this one uses Machine Learning 52 00:01:59,170 --> 00:02:01,350 ‫to predict future traffic ahead of time 53 00:02:01,350 --> 00:02:02,720 ‫so there's some algorithms, 54 00:02:02,720 --> 00:02:06,160 ‫they will look at the past traffic patterns, 55 00:02:06,160 --> 00:02:08,830 ‫and it will forecast what will happen 56 00:02:08,830 --> 00:02:11,910 ‫to traffic based on the past patterns. 57 00:02:11,910 --> 00:02:13,140 ‫And so the idea is that 58 00:02:13,140 --> 00:02:15,340 ‫it's called predictive because we predict 59 00:02:15,340 --> 00:02:17,810 ‫what the load will be over time, 60 00:02:17,810 --> 00:02:20,540 ‫and maybe the load is just on a daily basis 61 00:02:20,540 --> 00:02:22,010 ‫it peaks for three hours. 62 00:02:22,010 --> 00:02:23,380 ‫So this is the kind of things that 63 00:02:23,380 --> 00:02:25,157 ‫Predictive Scaling will pick up, okay. 64 00:02:25,157 --> 00:02:26,880 ‫And it will automatically provision 65 00:02:26,880 --> 00:02:28,495 ‫the right number of EC2 instances 66 00:02:28,495 --> 00:02:32,630 ‫in advance to match that predicted period. 67 00:02:32,630 --> 00:02:35,230 ‫So this is what the graphs you see on the right hand side. 68 00:02:35,230 --> 00:02:36,660 ‫This is very helpful 69 00:02:36,660 --> 00:02:38,550 ‫when you have time-based patterns 70 00:02:38,550 --> 00:02:40,964 ‫and you just want to have an easy, 71 00:02:40,964 --> 00:02:44,530 ‫without any intervention type of scaling 72 00:02:44,530 --> 00:02:45,610 ‫trust strategies 73 00:02:45,610 --> 00:02:46,870 ‫that is powered by Machine Learning, 74 00:02:46,870 --> 00:02:48,940 ‫then that would be Predictive Scaling. 75 00:02:48,940 --> 00:02:50,350 ‫So that's it for this lecture. 76 00:02:50,350 --> 00:02:51,210 ‫I hope you liked it. 77 00:02:51,210 --> 00:02:52,630 ‫And remember the strategies. 78 00:02:52,630 --> 00:02:54,380 ‫I will see you in the next lecture.