Hey, everyone, and welcome back.
Now in today's video, we are going to discuss about the cross zone load balancing.
Now, before we look into it, let's look into a scenario where the cross zone load balancing is disabled
in a load balancer to understand on the importance about it.
Now let's say that there are in total of two availability zone and your LP is registered to both of
these.
Now in the availability zone, number one, there are two AC two instances.
And in the availability zone, number two, there are eight AC two instances.
Now in an ideal scenario, what you would like that the traffic that reaches the load balancer should
be equally distributed across all of these ten AC two instances that are running across to availability
zone.
However, that is not always the case.
Now, if a cross zone load balancing is disabled, the load balancer node distributes traffic only across
the registered target in its availability zone.
For example, since there are two nodes that are available, the traffic will be distributed 5050 across
both of these.
And since there are two AC two instance in availability zone A, the traffic will be distributed 25
to 25%.
However, in the availability zone, number B, the traffic since 50% of the traffic is also reaching
the availability zone B and there are eight AC two instance, the 50% gets distributed by eight, so
6.25% of traffic reaches each AC two instance.
Now if you have this kind of a setup in a production environment, you'll always notice that there are
two servers that are always overloaded with traffic and this can slow things down.
So this is not the best of the approaches for production environments and this is one of the reasons
why you need to have the cross zone load balancing enabled.
So when you have the cross zone load balancing enable, each load balancer node distributes the traffic
across registered targets in all the enabled availability zones.
For example, since we have ten targets that are available and if the cross zone load balancing is enabled,
each of the ten targets receives 10% of the traffic.
That constitutes to be total of 100%.
So let's do one thing.
Let's quickly look into where exactly can we find this specific setting.
Now, generally, when you create a load balancer, in fact, let me show you this.
Let me quickly create a network load balancer.
I'll just call it as demo hyphen NHLBI.
Let's quickly go a bit down.
I'll be selecting certain availability zones here.
Again, you don't have to create a load balancer and just doing it because I wanted to show you where
exactly you can see the settings.
I'll select the target group.
Now one thing that you will see is that in this configuration page, you do not really have any option
for cross zone load balancing.
This is primarily because there are certain default configurations that are automatically added and
you will be able to modify this after the nhlbi gets created.
So let's open up the network load balancer.
Let's go a bit down.
Now, if you'll see over here, the cross zone load balancing it is showing as disabled.
So in case if you'd like for Nhlbi, this is something that you can enable it explicitly.
Now, if you create a classic load balancer, let's also try it out with this one.
I'll just give a default name now within your in the step where you add the AC two instances, you have
an explicit option related to the cross zone load balancing that you can either enable or you can either
disable.
All right.
So I hope that this you understood the basics of cross zone load balancing.
Now, before we conclude, let's look into some of the important pointers for someone, is that with
the application load balancer, the cross zone load balancing is always enabled.
So you don't really have to worry about this.
With the network and the gateway load balances, the cross zone load balancing is disabled by default.
So after you create that load balancer, you can go ahead and enable or disable the cross zone load
balancing at any time.
This is something that we have already seen.
So that's the quick overview about cross zone load balancing and with this will conclude today's video.