· Azure Load Balancer is a service you can use to distribute traffic across multiple virtual machines.
· Use Load Balancer to scale applications and create high availability for your virtual machines and services.
· Load balancers use a hash-based distribution algorithm.
· By default, a five-tuple hash is used to map traffic to available servers.
· The hash is made from the following elements:
o Source IP: The IP address of the requesting client.
o Source port: The port of the requesting client.
o Destination IP: The destination IP of the request.
o Destination port: The destination port of the request.
o Protocol type: The specified protocol type, TCP or UDP.
· Two products are available when you create a load balancer in Azure:
o Basic Load Balancers.
o Standard Load Balancer.
· Basic load balancers allow:
o Port forwarding
o Automatic reconfiguration
o Health probes
o Outbound connections through source network address translation (SNAT)
o Diagnostics through Azure Log Analytics for public-facing load balancers
· Basic load balancers can be used only with availability sets.
· Standard load balancers support all of the basic features.
· They also allow:
- HTTPS health probes
- Availability zones
- Diagnostics through Azure Monitor, for multidimensional metrics
- High Availability (HA) ports
- Outbound rules
- A guaranteed SLA (99.99% for two or more virtual machines)
· Load Balancer uses a health probe to determine the availability of each VM that’s referenced by addresses in the back-end pool.
· Load Balancer only sends requests to VMs that indicate they’re healthy.
· Load Balancer selects the IP address of a VM from the back-end pool by using an algorithm designed to distribute requests evenly.
· You can start additional VM instances and add their IP addresses to the back-end pool at any time.
· Load Balancer includes these new instances when it distributes user requests.
· Load Balancer can expose more than one public front-end IP address, and might have multiple back-end pools.
· This scheme enables you to reuse the same instance of Load Balancer to handle requests for different systems.
· Load Balancer needs to determine whether each VM referenced by the back-end pool is available for handling requests.
· You add a health probe to do this.
· A health probe sends regular ping messages to a port that you specify for the VMs in the back-end pool.
· You provide a service on the VMs that responds to these ping messages, with an HTTP 200 (OK) message.
· When the VM fails to respond after a specified number of attempts, Load Balancer assumes it’s unhealthy and removes it from the list of VMs that can accept user requests.
· The workload is then distributed among the remaining healthy VMs.
· Load Balancer continues to ping an unresponsive VM.
· If the VM starts to reply, it’s added back into the list of healthy VMs and starts receiving user requests again.
· You can visualize metrics for Load Balancer by using the Metrics page in the Azure portal.
· From a connectivity troubleshooting perspective, the most important metrics are Data Path Availability and Health Probe Status.
· Azure Load Balancer is limited to only load balancing and handling port-forwarding for the TCP and UDP protocols.
· You can’t use Load Balancer to manage requests submitted by using other network protocols such as ICMP.