TE

testing-load-balancers

Assesses load balancer configurations, testing traffic distribution algorithms, health checks, and failover mechanisms.

Install

mkdir -p .claude/skills/testing-load-balancers && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8518" && unzip -o skill.zip -d .claude/skills/testing-load-balancers && rm skill.zip

Installs to .claude/skills/testing-load-balancers

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Validate load balancer behavior, failover, and traffic distribution.
68 charsno explicit “when” trigger
Advanced

Key capabilities

  • Verify traffic distribution algorithms like round-robin
  • Test backend failover during simulated outages
  • Validate session persistence and sticky sessions
  • Check SSL/TLS termination and certificate validity
  • Monitor connection draining during backend removal

How it works

It sends controlled traffic through the load balancer and monitors backend responses to verify distribution, health check accuracy, and failover behavior.

Inputs & outputs

You give it
Load balancer endpoint and test traffic parameters
You get back
Traffic distribution report and failover timeline

When to use testing-load-balancers

  • Validating round-robin traffic distribution
  • Testing backend failover during simulated outages
  • Verifying SSL/TLS termination
  • Checking health check configuration

About this skill

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

  1. 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).
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. Document all results with request/response evidence and timing data.

Output

  • Traffic distribution report showing request counts per backend instance
  • Health check failover timeline with detection and recovery durations
  • Session persistence validation results
  • SSL/TLS certificate and configuration verification
  • Load balancer behavior summary with pass/fail for each test scenario

Error Handling

ErrorCauseSolution
All requests hit the same backendSession affinity enabled unintentionally or DNS cachingDisable sticky sessions for distribution tests; use different source IPs; bypass DNS cache
Health check passes but backend is unhealthyHealth check endpoint does not reflect actual application healthConfigure health checks to hit a deep endpoint that verifies database connectivity
502 Bad Gateway during failoverHealth check interval too long; load balancer still routing to failed backendReduce health check interval and failure threshold; verify deregistration delay settings
SSL certificate errorCertificate does not match domain or is expiredVerify certificate SAN entries; check expiration date; ensure full certificate chain is configured
Connection refused on backend portFirewall or security group blocking load balancer to backend trafficVerify security group rules allow traffic from load balancer subnet; check backend listen address

Examples

Traffic distribution test with curl:

#!/bin/bash
set -euo pipefail
declare -A counts
for i in $(seq 1 100); do
  backend=$(curl -s -H "Host: app.test.com" http://lb.test.com/health \
    | jq -r '.hostname')
  counts[$backend]=$(( ${counts[$backend]:-0} + 1 ))
done
echo "Traffic distribution:"
for backend in "${!counts[@]}"; do
  echo "  $backend: ${counts[$backend]} requests"
done

Failover test sequence:

set -euo pipefail
# 1. Verify both backends serve traffic
curl -s http://lb.test.com/health  # Backend A
curl -s http://lb.test.com/health  # Backend B

# 2. Stop Backend A
docker stop backend-a

# 3. Verify all traffic goes to Backend B (no errors)
for i in $(seq 1 10); do
  curl -sf http://lb.test.com/health || echo "FAIL: request $i"
done

# 4. Restart Backend A and verify it rejoins
docker start backend-a
sleep 10  # Wait for health check interval
curl -s http://lb.test.com/health  # Should see Backend A again

k6 load test against load balancer:

import http from 'k6/http';
import { check } from 'k6';

export const options = { vus: 50, duration: '30s' };

export default function () {
  const res = http.get('http://lb.test.com/api/data');
  check(res, {
    'status is 200': (r) => r.status === 200,  # HTTP 200 OK
    'response time < 500ms': (r) => r.timings.duration < 500,  # HTTP 500 Internal Server Error
  });
}

Resources

When not to use it

  • When testing load balancers without access to backend logs

Prerequisites

Load balancer deployedMultiple backend instancesHTTP client tools like curl or k6

Limitations

  • Health check endpoint must reflect actual application health
  • Session affinity can interfere with distribution tests

How it compares

It provides a systematic validation of load balancer logic rather than just checking if the service is up.

Compared to similar skills

testing-load-balancers side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
testing-load-balancers (this skill)027dReviewAdvanced
chaos-scenario02moReviewAdvanced
bazel-build-optimization142moNo flagsAdvanced
deployment-pipeline-design62moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

Search skills

Search the agent skills registry