WEBVTT
Kind: captions
Language: en

1
00:00:00.000 --> 00:00:07.078
Welcome to Domain 3. Last time we finished security and compliance. Now we start on compute.

2
00:00:07.155 --> 00:00:14.618
Today covers two ideas. First, choosing the right Amazon EC2 instance: what an instance type name

3
00:00:14.695 --> 00:00:22.081
means, and the five families the exam asks about. Second, elasticity: how EC2 Auto Scaling keeps

4
00:00:22.158 --> 00:00:29.544
the right number of servers running, and how Elastic Load Balancing spreads traffic across them.

5
00:00:29.621 --> 00:00:30.929
This is Task 3.3.

6
00:00:31.630 --> 00:00:38.836
An EC2 instance is a virtual server you rent. You pick an image with the operating system,

7
00:00:38.916 --> 00:00:44.600
and an instance type that sets the CPU, memory, storage and networking.

8
00:00:44.680 --> 00:00:51.006
The name tells you a lot. Take m7g.large. The m is the series: general purpose.

9
00:00:51.086 --> 00:00:58.131
Seven is the generation; higher is newer. The g is an option: an AWS Graviton processor,

10
00:00:58.211 --> 00:01:06.138
which is Arm-based. And large is the size. Move up to m7g.xlarge and you get more vCPUs and memory.

11
00:01:06.840 --> 00:01:12.632
Instance types are grouped into families, each tuned for a different mix.

12
00:01:12.711 --> 00:01:18.503
General purpose, the M and T series, balances CPU, memory and networking:

13
00:01:18.582 --> 00:01:25.485
good for web servers. Compute optimized, the C series, has high-performance processors.

14
00:01:25.564 --> 00:01:32.070
Memory optimized, R and X, holds large data sets in memory. Accelerated computing,

15
00:01:32.149 --> 00:01:37.782
such as P, G, Inferentia and Trainium, adds GPUs or other accelerators.

16
00:01:37.862 --> 00:01:43.098
And storage optimized, I and D, delivers very fast local disk I/O.

17
00:01:43.800 --> 00:01:49.819
Here's how to choose: find the bottleneck. The store's website, with steady traffic,

18
00:01:49.891 --> 00:01:56.269
runs fine on general purpose. Encoding product videos is CPU-bound, so compute optimized.

19
00:01:56.340 --> 00:02:03.005
A large in-memory product cache needs memory optimized. Training a recommendation model needs

20
00:02:03.076 --> 00:02:09.955
accelerators, so accelerated computing. And a database that hammers its local disk needs storage

21
00:02:10.027 --> 00:02:15.330
optimized. On the exam, the question usually names the bottleneck for you.

22
00:02:16.030 --> 00:02:22.009
Now our second idea. Traffic to the store isn't flat. It's quiet on a Monday night and huge on

23
00:02:22.067 --> 00:02:27.152
Black Friday. If the store runs a fixed four servers, it has too few at the peak,

24
00:02:27.303 --> 00:02:31.750
so the site slows down and sales are lost, and too many the rest of the week,

25
00:02:31.959 --> 00:02:37.938
so it pays for idle servers. Elasticity means capacity grows and shrinks with demand,

26
00:02:38.089 --> 00:02:44.823
automatically. The exam guide puts it simply: auto scaling provides elasticity.

27
00:02:45.570 --> 00:02:52.208
Amazon EC2 Auto Scaling manages instances in an Auto Scaling group. You set three numbers.

28
00:02:52.282 --> 00:02:58.257
The minimum: the group never drops below it. The maximum: it never goes above it.

29
00:02:58.331 --> 00:03:04.895
And the desired capacity: how many should run right now. When CPU rises above the target,

30
00:03:04.969 --> 00:03:12.124
desired goes from two to four, and new instances launch, spread evenly across Availability Zones.

31
00:03:12.198 --> 00:03:17.877
If an instance becomes unhealthy, it's replaced. Auto Scaling itself is free:

32
00:03:17.951 --> 00:03:19.869
you pay for the instances.

33
00:03:20.570 --> 00:03:26.268
How does the desired number change? Manual scaling: you change it yourself.

34
00:03:26.344 --> 00:03:32.195
Scheduled scaling: for events you know about, such as every Friday at six PM.

35
00:03:32.271 --> 00:03:37.893
Dynamic scaling reacts to a metric. Its most common form, target tracking,

36
00:03:37.969 --> 00:03:45.491
works like a thermostat: keep average CPU at 50 percent, and Auto Scaling adds or removes instances

37
00:03:45.567 --> 00:03:52.936
to hold it. AWS recommends it. And predictive scaling forecasts demand from past daily and weekly

38
00:03:53.012 --> 00:03:56.279
patterns, then adds capacity ahead of time.

39
00:03:56.980 --> 00:04:01.787
Shoppers can't keep track of changing servers, so we put a load balancer in front.

40
00:04:02.390 --> 00:04:08.938
Elastic Load Balancing gives the store one front door and spreads incoming traffic across instances

41
00:04:09.182 --> 00:04:15.718
in several Availability Zones. It runs health checks and sends traffic only to healthy targets.

42
00:04:16.415 --> 00:04:22.429
Here, one instance fails its check, so it gets no traffic, and Auto Scaling replaces it.

43
00:04:23.242 --> 00:04:28.454
New instances are registered with the load balancer automatically, and the load balancer scales

44
00:04:28.489 --> 00:04:29.720
itself.

45
00:04:30.460 --> 00:04:37.631
There are three current types. The Application Load Balancer works at layer 7 with HTTP,

46
00:04:37.712 --> 00:04:44.883
HTTPS and gRPC, and routes by path, host or header: send slash cart to the cart servers.

47
00:04:44.964 --> 00:04:51.890
Choose it for websites and APIs. The Network Load Balancer works at layer 4 with TCP,

48
00:04:51.972 --> 00:05:00.446
UDP and TLS, for extreme performance and static IP addresses. The Gateway Load Balancer runs third-party

49
00:05:00.528 --> 00:05:08.024
virtual appliances, such as firewalls. The Classic Load Balancer is the previous generation.

50
00:05:08.720 --> 00:05:15.301
Here's how the exam asks about this. Video encoding, batch jobs or game servers:

51
00:05:15.383 --> 00:05:21.388
compute optimized. A large in-memory database or cache: memory optimized.

52
00:05:21.471 --> 00:05:29.203
Machine learning training, GPUs or graphics: accelerated computing. High I/O on local storage:

53
00:05:29.285 --> 00:05:35.784
storage optimized. Matching capacity to demand automatically: EC2 Auto Scaling.

54
00:05:35.866 --> 00:05:42.694
Spreading traffic and sending it only to healthy instances: Elastic Load Balancing.

55
00:05:42.776 --> 00:05:48.452
Routing by URL path is an ALB; a static IP for TCP traffic is an NLB.

56
00:05:49.150 --> 00:05:54.653
To recap: an instance type name gives the series, generation, options and size.

57
00:05:55.292 --> 00:06:02.652
General purpose M and T suit most web servers; C is compute optimized, R and X are memory optimized,

58
00:06:03.059 --> 00:06:09.537
I and D are storage optimized, and P, G, Inferentia and Trainium are accelerated.

59
00:06:10.141 --> 00:06:14.796
Auto Scaling groups keep between a minimum and a maximum number of healthy instances,

60
00:06:15.075 --> 00:06:20.984
and load balancers spread traffic across them. Next, we'll run code without managing servers:

61
00:06:21.425 --> 00:06:23.422
containers and serverless.
