Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

testing-load-balancers测试负载均衡器

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

558

周安装

23

GitHub Stars

2,103

下载量

182
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:testing-load-balancers(测试负载均衡器)
来源仓库:https://github.com/jeremylongshore/claude-code-plugins-plus-skills
仓库路径:skills/testing-load-balancers
安装命令:
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill testing-load-balancers
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill testing-load-balancers

简介

用于负载均衡器的性能测试与配置验证。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

  • 适用于高并发、多节点部署环境下的流量分发检查。
  • 可模拟请求分布、健康检查与故障转移场景。
  • 应在隔离网络中进行,避免干扰真实用户流量。
  • testing-load-balancers 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

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).

  1. 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.

  1. 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.

  1. 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.

  1. 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.

  1. 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.

  1. 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

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.41%
按下载量换算70

Claude

30.91%
按下载量换算56

Cursor

17.85%
按下载量换算32

Gemini CLI

9.38%
按下载量换算17

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills