Lecture 184: Cross-Zone Load Balancing
- 课程:[NEW] AWS Certified Advanced Networking Specialty 2026
- 视频时长:05:53
- 来源:Udemy Lecture 28555989
- Slide 数量:6
- 画面切换:01:37、02:48、03:48、04:33、05:28
扫描说明
逐条读取了 Udemy 页面中的 126 条英文 Transcript cue,并按时间轴扫描全长约 05:53 的视频。依据启用 Cross-zone 的均匀分流、关闭时的 AZ 内分流、各 Load Balancer 默认值与费用、NLB/GWLB 配置、ALB Target Group Override 及 CLB/清理划分为 6 个小节。截图均在 Transcript 侧栏关闭、播放器控件隐藏后复核,统一为 1364×770。
Transcript 来自 Udemy 页面自带的英文自动字幕,没有使用 ASR。下面保留页面原文,包括其中的语法或识别错误。
1. 启用 Cross-zone 后跨所有 AZ 均匀分流
时间范围:00:00–01:37
总结 / Summary
中文
启用 Cross-zone Load Balancing 时,每个 Load Balancer Node 都可以把请求发往所有启用 AZ 中的 Registered Instance。示例中 AZ1 有 2 台、AZ2 有 8 台,共 10 台 Target;无论 Client 先进入哪个 Node,每台 Instance 最终都获得约 10% 总流量。
English
With cross-zone load balancing enabled, every load balancer node can send requests to registered instances in all enabled AZs. In the example, AZ1 has two targets and AZ2 has eight, for ten total. Regardless of which node the client first reaches, each instance receives about 10% of the overall traffic.
Transcript
00:00 Now let's talk about cross zone balancing.
00:03 So let's take an example of a very imbalanced situation
00:06 but it will illustrate the point.
00:08 So we two availability zones
00:10 and the first one has a load balancer
00:11 with two EC2 instances.
00:13 And the second one also has a load balancer.
00:15 So a load balancer instance obviously,
00:18 with eight EC2 instances.
00:19 The Load balance serves instances are part
00:21 of the same more general load balancer.
00:25 So the client is accessing these load balancers.
00:28 And so with cross zone load balancing
00:32 each load balancer instance will distribute evenly
00:35 across all registered instances in all availability zones.
00:39 So the client itself is sending 50%
00:42 of the traffic to the first ALB instance
00:45 and 50% of traffic to the other ALB instance.
00:49 But each ALB is going to redirect the traffic
00:52 across all 10 EC2 instances
00:55 regardless of which availability zones they're in.
00:58 This is why it's called cross zone load balancing.
01:01 So if you take a look at the first
01:03 at the second ALB, sorry instance
01:05 it's going to send 10% of the traffic it receives, okay?
01:09 To all these instances because we have 10 instances.
01:14 So each of them gets 10% of the traffic.
01:16 And same story with the first ALB instance.
01:20 It's going to send also 10%
01:21 of traffic to all these instances.
01:23 So in this example with cross zone balancing
01:26 we are distributing the traffic evenly
01:29 across all EC2 instances.
01:31 And then maybe something you want to have or not, who knows
01:34 but at least this behavior is available to you.
2. 关闭 Cross-zone 后流量局限在本 AZ
时间范围:01:37–02:48
总结 / Summary
中文
关闭 Cross-zone 时,每个 Load Balancer Node 只在自己 AZ 的 Target 之间分流。若 DNS 让两个 AZ Node 各接收 50% 请求,那么 AZ1 的两台各得约 25%,AZ2 的八台各得约 6.25%;Target 数量不均会导致 Instance Load 明显不均。
English
Without cross-zone balancing, each load balancer node distributes only among targets in its own AZ. If DNS sends 50% of traffic to each AZ node, the two AZ1 targets receive about 25% each while the eight AZ2 targets receive about 6.25% each. Uneven target counts therefore create uneven per-instance load.
Transcript
01:37 The second behavior that's available
01:39 to you is to not have cross zone balancing.
01:42 So we take the same example
01:44 but without cross zone balancing.
01:46 The requests, the requests, sorry, are distributed
01:49 in the instances of the node of the elastic load balancer.
01:53 So in this example, what we have is that the client
01:56 sends 50% of the traffic to the first AZ and the 50%
02:00 of traffic to the second AZ, okay?
02:02 But the first ALB instance is going to send the traffic
02:07 to only the EC2 instances in its region.
02:09 So that means that each EC2 instance in this sorry ability
02:14 zone is going to get 25% of the traffic overall, okay?
02:16 So half and half.
02:18 And the one on the right hand side will again divide
02:20 up the traffic it receives into the EC2 instances
02:23 that are registered within its AZ.
02:24 So AZ2.
02:26 So we can see here without cross balancing
02:29 the traffic is contained within each AZ.
02:32 But if there are an imbalanced number of EC2 instances
02:36 in each AZ, then some EC2 instances of a specific AZ we'll
02:40 receive more traffic than others.
02:42 It's just an option to know about.
02:44 There's no right or wrong answer.
02:46 It depends on the use case, obviously.
3. ALB、NLB、GWLB 与 CLB 的默认值和费用
时间范围:02:48–03:48
总结 / Summary
中文
ALB 默认启用 Cross-zone,可在 Target Group Level 关闭,课程指出跨 AZ 数据无额外费用。NLB 与 GWLB 默认关闭,启用后 Inter-AZ Data 可能产生费用。CLB 默认关闭,启用时课程指出不收取 Inter-AZ Data Transfer 费用。
English
ALB enables cross-zone balancing by default and can disable it at the target-group level; the course states there is no extra inter-AZ data charge. NLB and GWLB disable it by default and may incur inter-AZ data charges when enabled. CLB disables it by default, and the course states that enabling it does not add inter-AZ transfer charges.
Transcript
02:48 So for the application balancer, by default
02:52 cross zone load balancing is going to be enabled
02:55 but you can disable it at the target group level and
02:58 there's going to be no charges
03:00 if your data goes across availability zones
03:03 because usually in AWS, if data goes
03:06 from one AZ to another one, you're going to pay some money.
03:09 But for the application balancer
03:11 because cross zone lowdown is enabled by default
03:14 you won't have any charges for inter AZ data.
03:19 Now, if you consider the network load balancer
03:21 and the gateway load balancer,
03:23 then cross zone load balancing is disabled by default.
03:26 And if you enable it
03:28 then you're going to pay some amount of money
03:31 because the data is going to go from one AZ to the next.
03:36 Finally, for the classic load balancer
03:38 it is disabled by default, and in case you enable it
03:42 you're not going to be charged for inter AZ data transfers.
4. 在 NLB 与 GWLB Attributes 启用 Cross-zone
时间范围:03:48–04:33
总结 / Summary
中文
在 NLB 的 Attributes 编辑 Target Selection Configuration,可打开 Cross-zone Load Balancing;Console 会提示 Regional Data Transfer Charge 可能适用。GWLB 的设置与默认行为相同,也是在 Load Balancer Attributes 中从 Off 改为 On,并承担相应跨区费用。
English
In NLB attributes, edit target selection configuration to enable cross-zone load balancing. The console warns that regional data transfer charges may apply. GWLB uses the same default and configuration pattern: change the load balancer attribute from off to on and account for cross-zone charges.
Transcript
03:48 Okay, so just for the sake of doing a hands on
03:51 I've created a workload balancer, an application balancer
03:55 and a gateway load balancer.
03:57 So let's first have a look at the network load balancer.
04:00 So if I scroll down and click on attributes, as you can see
04:03 cross zone low balancing is off
04:06 but I can edit this and turn this on.
04:09 And as you can see, I will enable cross zone balancing
04:12 and this may include some regional charges for your NLB.
04:18 So this is a similar setting for the gateway low balancer
04:21 because they have a similar behavior in that regard.
04:24 So for the attributes, again, cross zone
04:26 load balancing is off
04:28 but I can edit it and turn it on.
04:30 And this will imply data charges.
5. ALB 通过 Target Group 覆盖 Cross-zone 行为
时间范围:04:33–05:28
总结 / Summary
中文
ALB Load Balancer Level 的 Cross-zone 始终为 On;要对单个 Backend 调整,应进入 Target Group Attributes。Cross-zone Setting 可以继承 ALB 默认值,也可以对该 Target Group 强制 On 或 Off,因此不同 Target Group 可采用不同策略。
English
Cross-zone balancing is always on at the ALB load-balancer level. To change behavior for one backend, edit the target group attributes. The target group can inherit the ALB default or explicitly force cross-zone on or off, allowing different policies per target group.
Transcript
04:33 Now if you have a look at the application load balancer
04:36 it is a little bit different.
04:38 So if you go to attributes
04:40 you can see that cross zone load balancing is on by default.
04:44 And if I edit this and and scroll down, as you can see
04:48 I will show you in a second.
04:50 As you can see, the cross zone balancing is always on,
04:53 okay?
04:54 And this message
04:55 you can discard it because I think it's wrong.
04:57 But anyway, so cross zone load balancing
04:59 is always on for your ALB.
05:01 But if you go to your actual target group, so if I go
05:06 to my target group that has been created for this and I go
05:11 to attributes of the target group, we can actually do edit.
05:15 And for the cross zone load balancing here, we can
05:19 either inherit settings from the low balancer attributes
05:21 which is on by default or force on or off
05:25 and turn it off for that one specific target group.
6. CLB 已属旧一代,并清理演示资源
时间范围:05:28–05:53
总结 / Summary
中文
课程没有继续演示 CLB,因为它是即将退出的 Previous-generation Load Balancer。若跟做实验,最后应删除为本讲创建的 DemoNLB、DemoALB 与 DemoGWLB,避免继续计费。
English
The course skips a CLB demo because it is a retiring previous-generation load balancer. If following the exercise, delete the created DemoNLB, DemoALB, and DemoGWLB afterward to avoid ongoing charges.
Transcript
05:28 And when it comes
05:29 to doing the demo for the classic load balancer,
05:32 I will not include it this time
05:34 because the classic load balancer is going away.
05:37 It is previous generation
05:39 and is going to be retired very soon.
05:40 So I don't think you will need to know
05:41 about it for the exam.
05:43 Okay, so let's see.
05:45 For this lecture, just make sure
05:46 if you wanted to follow along to delete the load balancers.
05:49 I hope you liked it and I will see you in the next lecture.
整讲总结 / Overall Summary
中文
Cross-zone Load Balancing 决定每个 Load Balancer Node 是只向本 AZ Target 分流,还是跨所有启用 AZ 选择 Target。目标数不均时,启用它可实现全局均匀分配;关闭则保持 AZ Locality。ALB 默认 On 且可在 Target Group 覆盖,跨区无课程所述额外费用;NLB/GWLB 默认 Off,启用可能收费;CLB 默认 Off。跟做演示后要删除创建的 Load Balancer。
English
Cross-zone load balancing determines whether each load balancer node routes only to targets in its own AZ or across all enabled AZs. With uneven target counts, enabling it produces global even distribution, while disabling it preserves AZ locality. ALB defaults on and can be overridden per target group without the course-stated extra cross-AZ charge; NLB/GWLB default off and may charge when enabled; CLB defaults off. Delete demo load balancers after the exercise.
返回顶部 ↑