Learn the differences between the two Azure load balancers and when to use each one. Get an overview of the Azure Load Balancer.
- [Narrator] The Azure load balancer provides high availability by distributing the traffic across multiple VMs while the Azure traffic manager distributes traffic to different end points at different data centers. Let's start off with the Azure load balancer which is really no different than a load balancer on premise. It distributes traffic to the virtual machines within an availability set. And we have two types of load balancers in Azure. Our first load balancer handles the external load balancing which manages our internet traffic.
And we have an internal load balancer which manages the traffic between tiers and it can also be used to manage traffic from our on premise environments. Let's first take a look at our external load balancer. Let's assume a request for data is coming in on HTTP port 80. The request is handled by the load balancer that then distributes the traffic to an internal resource. In our example here, we have virtual machines. Our internal load balancer handles traffic that is generated internally.
Let's go ahead and continue the build on our example. We can now add in the internal load balancer which takes the traffic from the website servers and then directs the traffic destined for port 1433 on our back hand line of business servers. By default, the load balancer will distribute the traffic equally between those virtual machine instances. The internal load balancer can also manage the traffic coming from the VPN connection from our on premise environment. This provides a direct connection from our on premise to our back end servers.
The Azure load balancer will monitor the virtual machines by probing the end points every 15 seconds. The balancer expects a response of HTTP 200 OK. If it doesn't receive this response or if the time out is greater than 31 seconds, then the machine is considered unhealthy and any new request will not be forwarded to that unhealthy machine. In our example here, traffic that comes in on Port 80 is distributed between the three virtual machines.
If a virtual machine is deemed unhealthy, the traffic will not be directed to that virtual machine. When the machine is then determined to be healthy traffic will be redirected back to that virtual machine. There are a few load balancing rules that you do need to be aware of. First of all, the load balancer directs the traffic based on the port number. You can enable session persistence which will guarantee that the client will always connect to the same virtual machine instance during a session.
And finally, you can enable floating IP or direct server return and you may be asking what is a floating IP or direct server return? And the short answer is it disables NAT. You will need to enable this when you're configuring SQL AlwaysOn availability group listener. Otherwise, leave the default as disabled. Now let's spend some time of traffic manager. Traffic manager will control traffic between Azure data centers, external and non-Azure endpoints. The traffic manager uses DNS to direct client requests based on the best traffic routing methods.
It will continuously monitor the endpoint health and will failover automatically to another endpoint when the primary endpoint is considered unhealthy. There are three traffic manager methods. We have latency which directs the traffic to the closest services and this may not be the closest physical service but the service with reduced latency. There is Round-robin which distributes the traffic equally among the services. And finally, there is Failover that will direct the traffic to services that are up and running.
Let's go ahead and take a look at the traffic manager workflow. As you can see here, we have our clients and we have two services, one happens to be sitting in Europe and the other in the west US. The client sends a request to the recursive DNS. You may also know recursive DNS as local DNS and our example, the request is for mycompany.com. The DNS service requests the DNS record from an authoritative DNS service. The CNAME of mycompany.trafficmanager.net is then returned.
Next, the request is sent to the Azure traffic manager service which in turn returns the appropriate endpoint back to the local DNS server based on our traffic manager method which could be the latency, the Round-robin, or Failover. The traffic manager then passes the endpoint back to the DNS server which passes it back to the clients. The client will then connect to the given IP address directly. Remember, the Azure load balancer uses port numbers to determine where traffic is to be directed, whereas, the Azure traffic manager leverages DNS to direct the clients to the appropriate service.
- Designing virtual machines
- Selecting appropriate VM SKUs
- Designing template deployment
- Deploying ARM templates via PowerShell and CLI
- Designing for availability
- Designing Azure Virtual Networks
- Azure VPN and ExpressRoute architecture and design