Load Balancer Tester
Overview
Validate load balancer behavior including traffic distribution algorithms, health check mechanisms, failover scenarios, session persistence, and SSL termination. Supports testing for NGINX, HAProxy, AWS ALB/NLB, GCP Load Balancers, and Kubernetes Ingress controllers.
Prerequisites
- Load balancer deployed and accessible in a test environment
- Multiple backend instances running with identifiable responses (hostname headers)
- HTTP client tools (
curl, wrk, hey, or k6) for sending test traffic
- Access to load balancer configuration and health check settings
- Ability to stop/start backend instances to simulate failures
Instructions
- Verify basic load balancer connectivity:
- Send a request through the load balancer and confirm a backend response.
- Check the response includes identifying headers (
X-Backend-Server, Server) to determine which instance served the request.
- Verify SSL/TLS termination works correctly (valid certificate, proper redirect from HTTP to HTTPS).
- Test traffic distribution algorithm:
- Send 100+ sequential requests and record which backend handled each.
- For round-robin: verify even distribution across all backends (within 5% tolerance).
- For least-connections: verify the least-loaded backend receives new requests.
- For weighted: verify traffic ratio matches configured weights.
- Validate health check behavior:
- Stop one backend instance.
- Verify the load balancer detects the failure within the configured health check interval.
- Confirm subsequent requests are routed only to healthy backends (zero errors).
- Restart the backend and verify it is returned to the pool after passing health checks.
- Test failover scenarios:
- Stop all backends except one and verify the remaining backend handles all traffic.
- Stop all backends and verify the load balancer returns a 502 or 503 error (not hang).
- Simulate slow backend responses and verify timeout behavior.
- Validate session persistence (sticky sessions):
- Send multiple requests with the same session cookie.
- Verify all requests route to the same backend instance.
- Verify a new session (no cookie) can route to any backend.
- Test connection draining:
- Start a long-running request, then remove the backend from the pool.
- Verify the in-flight request completes successfully.
- Verify new requests route to remaining backends.
- Document all results with request/response evidence and timing data.
Output
- Traffic distribution report show