Azure Load balancing is a Layer-4 (TCP, UDP) that provides high availability by distributing incoming traffic among healthy VMs. A load balancer health probe monitors a given port on each VM and only distributes traffic to an operational VM.
The job of a load balancer is to take on client requests, determine which machines in the set can manage such requests, and finally, forwarding those requests to the relevant machines.
Types of Load Balancer:
→ Standard load balancers
- Load Balancing between virtual machines.
- Increase in the backend instance pool size and the number of permitted inbound NAT rules.
- Support for cross-zone load balancing and virtual IPs.
- Integrated Monitoring and Diagnostics.
- There are two types of Standard Load balancer:
1. Internet facing Load balancer
2. The internal-facing Load balancer
→ Public load balancers
- Every cloud service get a free public load balanced IP (VIP)
- You can balance the load on multiple VIPs you can get additional VIPs at a normal charge.
- You can assign up to five additional IPs to your Load Balancer.
→ Internal load balancers
- Load balancing between virtual machines that reside inside of a virtual network ( Internal Load Balancing) is free of charge.
Need for a Load Balancer:
→ A public load balancer will load-balance the incoming internet traffic to your virtual machines. Load balance the traffic across virtual machines inside a virtual network.
→ A hybrid scenario of an on-premises network, you can also get to a load balancer front end. A configuration known as the Internal Load Balancer is utilized in both scenarios.
→ You can also port forward traffic to a particular port on particular virtual machines with inbound NAT(network address translation) rules.
→ Azure load balancer enables you to offer outbound connectivity for virtual machines inside your virtual network by utilizing a public load balancer.
Fundamental Load Balancer features
→ Load balancing: With Azure Load Balancer, you can create a load-balancing rule to distribute traffic that arrives at frontend to backend pool instance.
→ Port forwarding: With Load Balancer, you can create an inbound NAT rule to port forward traffic from a specific port of a specific frontend IP address to a specific port of a specific backend instance inside the virtual network.
→ Automatic reconfiguration: Load Balancer instantly reconfigures itself when you scale instances up or down. Adding or removing VMs from the backend pool reconfigures the Load Balancer without additional operations on the Load Balancer resource.
→ Health probes: To determine the health of instances in the backend pool, Load Balancer uses health probes that you define. When a probe fails to respond, the Load Balancer stops sending new connections to the unhealthy instances
→ Outbound connections (SNAT): All outbound flows from private IP addresses inside your virtual network to public IP addresses on the internet can be translated to a frontend IP address of the Load Balancer.
These step would involve in configuring:
- Create an Azure load balancer
- Create a load balancer health probe
- Create load balancer traffic rules
- Use the Custom Script Extension to create a basic IIS site
- Create virtual machines and attach to a load balancer
- View a load balancer in action
- Add and remove VMs from a load balancer