agentleFS
NikoxkxNikoxkx/Agent-Skills/skills/devops/load-balancer-config/SKILL.md

load-balancer-config

Skill1 starsChanged 5 months agoApache-2.0View on GitHub

Configures load balancers for high availability, health checking, and traffic distribution. Use when distributing traffic across multiple backend instances.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use a dedicated lightweight endpoint that checks critical dependencies (DB, cache) or a simpler one.

    line 38
  2. Distinctive:

    Document why sticky is needed and plan to remove it.

    line 47
  3. Distinctive:

    Session affinity breaking deploys: Use cookie-based affinity with proper drain.

    line 75
  4. Distinctive:

    gRPC / WebSocket: Ensure the LB supports the protocol (ALB supports gRPC, Nginx needs special config).

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Overview

Configures load balancers (AWS ALB/NLB, Nginx, HAProxy) for high availability with proper health checks, traffic distribution algorithms (round-robin, least connections, ip-hash), sticky sessions when needed, SSL termination, connection draining, and advanced traffic splitting (blue-green, canary, A/B).

When to Use This Skill

  • Running multiple instances of an app behind a load balancer.
  • Implementing zero-downtime deploys or canary releases.
  • Adding high availability or geographic distribution.

Prerequisites

  • Multiple backend instances (or containers/pods) of the same app.
  • Health check endpoint on the app (/health or /ready).
  • DNS or cloud load balancer service.

Steps

  1. Choose LB type:
    • Layer 7 (ALB, Nginx, HAProxy) for HTTP features (path routing, headers, canary).
    • Layer 4 (NLB, HAProxy TCP) for raw TCP/UDP or when you need extreme performance.
  2. Health checks:
    • Path, interval, timeout, healthy/unhealthy thresholds.
    • Separate liveness vs readiness if using Kubernetes.
    • Use a dedicated lightweight endpoint that checks critical dependencies (DB, cache) or a simpler one.
  3. Algorithms:
    • Round robin (default, even distribution).
    • Least connections (good for long-lived connections).
    • IP hash / source IP (for sticky sessions when state is local).
  4. Sticky sessions (when unavoidable):
    • Cookie-based (preferred) or source IP.
    • Document why sticky is needed and plan to remove it.
  5. SSL termination:
    • Terminate at LB (recommended) — backends can stay on HTTP.
    • Or pass-through (rare).
  6. Connection draining / deregistration:
    • Deregistration delay (AWS) or slow start / drain timeout.
    • Essential for zero-downtime deploys.
  7. Traffic splitting:
    • Blue-green: two target groups, switch listener rule or DNS.
    • Canary: weighted target groups (ALB, Nginx, HAProxy, or service mesh).
    • Header or cookie based routing for A/B.
  8. Output:
    • Config for the chosen LB (ALB listener + target group Terraform, Nginx upstream + server block, HAProxy frontend/backend).
    • Health check endpoint recommendation for the app.
    • Blue-green and canary deployment scripts or Terraform.
    • Monitoring (LB 5xx, latency, healthy host count).

Examples

AWS ALB Terraform for a blue-green setup, an Nginx config with least-conn and sticky cookie, an HAProxy example with canary weighting, and health check implementation guidance are included.

Edge Cases & Error Handling

  • All backends unhealthy: LB should return 503 or a maintenance page. Configure a fallback.
  • Session affinity breaking deploys: Use cookie-based affinity with proper drain.
  • gRPC / WebSocket: Ensure the LB supports the protocol (ALB supports gRPC, Nginx needs special config).

Verification

  1. Deploy multiple backends.
  2. Send traffic — it is distributed (check logs or metrics on each backend).
  3. Kill one backend — health check removes it, traffic continues on the others.
  4. Perform a blue-green or canary deploy — no or minimal user impact.
  5. Success: Traffic is balanced, unhealthy instances are automatically removed, and advanced deployment strategies work without downtime.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.