Azure Load Balancer
Azure Load Balancer is a Layer 4 (TCP/UDP) load balancer that enables you to distribute network traffic to applications. It provides high availability and helps improve application responsiveness by offloading the client from the original backend pool.
Key Features and Benefits
- High Availability: Distributes incoming traffic across multiple instances of an application, ensuring that if one instance fails, traffic is routed to healthy instances.
- Scalability: Handles fluctuating traffic demands by scaling resources up or down as needed.
- Performance: Improves application responsiveness by reducing latency and optimizing resource utilization.
- Layer 4 Load Balancing: Operates at the transport layer, balancing traffic based on IP address and port.
- Internal and External: Supports both public-facing (internet) and internal (private network) load balancing scenarios.
- Health Probes: Continuously monitors the health of backend instances to ensure traffic is only sent to responsive resources.
Load Balancer SKUs
Azure Load Balancer offers two SKUs: Basic and Standard. The Standard SKU provides enhanced features and higher performance.
Basic SKU
The Basic SKU is suitable for development and testing environments. It provides core load balancing functionalities but lacks some advanced features like availability zones and more robust diagnostics.
Standard SKU
The Standard SKU is recommended for production workloads. It offers:
- Support for Availability Zones for higher resilience.
- More robust health probes and diagnostic capabilities.
- Higher throughput and connection limits.
- Network Security Group (NSG) integration for enhanced security.
- Direct Server Return (DSR) support.
Load Balancing Rules
Load balancing rules define how incoming traffic is directed to backend instances. Key components include:
- Frontend IP configuration: The IP address clients connect to.
- Backend address pool: A set of virtual machines or services that will receive the traffic.
- Port forwarding: Mapping an incoming port to a backend port.
- Health probe: Configuration for checking the health of backend instances.
Example Configuration
Here's a conceptual example of a load balancing rule:
# Example using Azure CLI for Standard Load Balancer
az network lb rule create \
--resource-group MyResourceGroup \
--lb-name MyLoadBalancer \
--name http-rule \
--protocol Tcp \
--frontend-port 80 \
--backend-port 80 \
--frontend-ip-name MyFrontendIP \
--backend-address-pool MyBackendPool \
--health-probe MyHealthProbe