Skip to content
Back to skills

Load Balancing

ASecurity

Comprehensive guide to load balancing algorithms, health checks, and high-availability patterns.

  • 666 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 9, 2026
devopsgonodekubernetesawsgcpazureapibackenddevopssecurity

Works with

  • cli
  • api

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill load-balancing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Load Balancing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Load Balancing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-load-balancing/badge)](https://www.skillsdirectory.com/skills/majiayu000-load-balancing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Load Balancing Strategies
description: Comprehensive guide to load balancing algorithms, health checks, and high-availability patterns.
---

# Load Balancing Strategies

## Overview

Load balancing distributes traffic across multiple targets to improve
availability, performance, and resilience. This guide covers algorithms,
health checks, and operational best practices.

## Table of Contents

1. [Fundamentals](#fundamentals)
2. [Layer 4 vs Layer 7](#layer-4-vs-layer-7)
3. [Algorithms](#algorithms)
4. [Health Checks](#health-checks)
5. [Session Persistence](#session-persistence)
6. [TLS Termination](#tls-termination)
7. [Connection Draining](#connection-draining)
8. [Global Load Balancing](#global-load-balancing)
9. [Cloud Load Balancers](#cloud-load-balancers)
10. [Software Load Balancers](#software-load-balancers)
11. [Service Mesh Load Balancing](#service-mesh-load-balancing)
12. [Autoscaling Integration](#autoscaling-integration)
13. [Monitoring](#monitoring)
14. [Troubleshooting](#troubleshooting)

---

## Fundamentals

Core goals:
- Spread traffic evenly
- Avoid single points of failure
- Improve latency by routing to healthy targets

## Layer 4 vs Layer 7

- **Layer 4 (TCP/UDP)**: Fast, protocol-agnostic, no HTTP awareness.
- **Layer 7 (HTTP/HTTPS)**: Route by path/host/headers, supports TLS termination.

## Algorithms

Common strategies:
- **Round Robin**: Simple rotation.
- **Weighted Round Robin**: Bias to stronger nodes.
- **Least Connections**: Route to least busy.
- **Weighted Least Connections**: Combine weight + load.
- **IP Hash**: Sticky routing by client IP.
- **Random**: Low overhead.
- **Least Response Time**: Prefer lowest latency target.

## Health Checks

Types:
- **Active**: Probes at intervals.
- **Passive**: Detect failures from live traffic.

Use both for best detection and recovery.

## Session Persistence

Sticky sessions route a client to the same target:
- Cookie-based affinity
- IP hash

Use only when state cannot be externalized.

## TLS Termination

Terminate TLS at the load balancer for:
- Centralized cert management
- Better performance
- Easier observability

Optionally re-encrypt to backend for end-to-end security.

## Connection Draining

Allow in-flight requests to finish during scale-down or deploy:
- Set drain timeout
- Stop new connections

## Global Load Balancing

GSLB routes across regions:
- Geo-based routing
- Latency-based routing
- Failover routing

## Cloud Load Balancers

- **AWS**: ALB (L7), NLB (L4)
- **GCP**: HTTP(S) Load Balancer, TCP/UDP LB
- **Azure**: Application Gateway, Azure Load Balancer

## Software Load Balancers

- **NGINX**: Popular L7 proxy with health checks.
- **HAProxy**: High performance L4/L7.
- **Envoy**: Modern proxy with rich telemetry.

## Service Mesh Load Balancing

Service meshes (Istio, Linkerd) provide client-side load balancing with
retry policies, circuit breaking, and telemetry.

## Autoscaling Integration

Combine with autoscaling:
- Scale on CPU, latency, or queue depth
- Pre-warm nodes to reduce cold starts

## Monitoring

Track:
- Request rate and latency
- Backend error rates
- Health check failures
- Uneven traffic distribution

## Troubleshooting

Common issues:
- Misconfigured health checks (false negatives)
- Sticky sessions causing hot spots
- TLS mismatch or SNI routing errors
- Draining too short for long requests

## Related Skills
- `09-microservices/api-gateway`
- `09-microservices/service-mesh`
- `15-devops-infrastructure/kubernetes-helm`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.