Skip to content
load-testing-apis logo

Load Testing APIs

load-testing-apis

Execute comprehensive load and stress testing to validate API performance

SKILL.md

Full skill instructions

Load Testing APIs

Overview

Execute comprehensive load, stress, and soak tests to validate API performance, identify bottlenecks, and establish throughput baselines. Generate test scripts for k6, Artillery, or wrk that simulate realistic traffic patterns with configurable virtual user ramp-up, request distribution, and failure threshold assertions.

Prerequisites

  • Load testing tool installed: k6 (recommended), Artillery, wrk, or Apache JMeter
  • Target API deployed in a staging/​performance environment (never load test production without safeguards)
  • Monitoring stack accessible: Grafana/​Prometheus, Datadog, or CloudWatch for correlating test results with server metrics
  • API authentication credentials for testing (API keys, test user JWT tokens)
  • Baseline performance SLOs defined (target p95 latency, max error rate, minimum throughput)

Instructions

  1. Read the API specification and route definitions using Glob and Read to build a complete list of endpoints, identifying high-traffic paths and resource-intensive operations.
  2. Define test scenarios modeling realistic user behavior: browsing (80% reads), checkout (mixed reads + writes), and spike traffic patterns with appropriate think times between requests.
  3. Generate k6 or Artillery test scripts with configurable stages: ramp-up (2 min), sustained load (10 min), spike (2 min at 3x), and cool-down (2 min).
  4. Configure request distribution to match production traffic patterns -- weighted random selection across endpoints rather than uniform distribution.
  5. Add threshold assertions for pass/​fail criteria: p95 response time < 500ms, error rate < 1%, throughput > 100 requests/​second.
  6. Implement data-driven requests using CSV or JSON fixtures for realistic payloads, unique user IDs, and varied query parameters to avoid cache-only testing.
  7. Execute baseline test at expected production load, then gradually increase to 2x, 5x, and 10x to identify the breaking point and saturation behavior.
  8. Analyze results: correlate latency spikes with server metrics (CPU, memory, DB connections, event loop lag), identify the bottleneck (database, network, compute), and document findings.
  9. Generate a performance report comparing results against SLO thresholds with recommendations for optimization.

See ${CLAUDE_SKILL_DIR}/​references/​implementation.md for the full implementation guide.

Output

  • ${CLAUDE_SKILL_DIR}/​load-tests/​scenarios/ - k6/​Artillery test scripts per traffic scenario
  • ${CLAUDE_SKILL_DIR}/​load-tests/​data/ - Test data fixtures (users, payloads, tokens)
  • ${CLAUDE_SKILL_DIR}/​load-tests/​thresholds.json - Pass/​fail threshold configuration
  • ${CLAUDE_SKILL_DIR}/​reports/​load-test-results.json - Raw test results with timing data
  • ${CLAUDE_SKILL_DIR}/​reports/​load-test-summary.md - Human-readable performance analysis report
  • ${CLAUDE_SKILL_DIR}/​reports/​bottleneck-analysis.md - Identified bottlenecks with remediation recommendations

Error Handling

ErrorCauseSolution
Connection refusedTarget server ran out of file descriptors or connection pool exhaustedIncrease server ulimit and connection pool size; note the concurrent connection limit
Timeout spike at ramp-upServer cannot handle connection establishment rateImplement connection pre-warming; increase ramp-up duration; add connection pooling
429 responses dominate resultsRate limiter engaging during load testWhitelist load test source IPs in rate limiter; or test rate limiter behavior separately
Inconsistent baseline resultsShared staging environment with other trafficIsolate test environment; run tests during off-hours; use dedicated performance environment
Memory leak detectedSoak test shows steadily increasing memory over hoursFlag for development team; identify leaking endpoint by isolating test scenarios

Refer to ${CLAUDE_SKILL_DIR}/​references/​errors.md for comprehensive error patterns.

Examples

E-commerce checkout flow: Simulate 500 concurrent users browsing products (GET, 70%), adding to cart (POST, 20%), and completing checkout (POST, 10%) with 2-5 second think times between actions.

API spike test: Ramp from 50 to 1000 virtual users in 30 seconds to simulate traffic spike from marketing campaign launch, verifying the auto-scaler responds and latency recovers within 60 seconds.

Soak test for memory leaks: Sustain 200 concurrent users for 4 hours, monitoring server memory, connection counts, and response times for degradation patterns indicating resource leaks.

See ${CLAUDE_SKILL_DIR}/​references/​examples.md for additional examples.

Resources

More skills from jeremylongshore

openrouter-compliance-review logo
jeremylongshore/claude-code-plugins-plus-skills

openrouter-compliance-review

Review OpenRouter integration for regulatory compliance (SOC2, GDPR,

2.8K 0
View
maintainx-data-handling logo
jeremylongshore/claude-code-plugins-plus-skills

maintainx-data-handling

Data synchronization, ETL patterns, and data management for MaintainX.

2.8K 0
View
groq-core-workflow-a logo
jeremylongshore/claude-code-plugins-plus-skills

groq-core-workflow-a

Execute Groq primary workflow: chat completions with tool use and JSON

2.8K 0
View
validating-csrf-protection logo
jeremylongshore/claude-code-plugins-plus-skills

validating-csrf-protection

Validate CSRF protection implementations for security gaps. Use when

2.8K 0
View
api-contract logo
jeremylongshore/claude-code-plugins-plus-skills

api-contract

Configure this skill should be used when the user asks about "API contract",

2.8K 0
View
ideogram-incident-runbook logo
jeremylongshore/claude-code-plugins-plus-skills

ideogram-incident-runbook

Execute Ideogram incident response with triage, mitigation, and postmortem.

2.8K 0
View
gamma-sdk-patterns logo
jeremylongshore/claude-code-plugins-plus-skills

gamma-sdk-patterns

Reusable patterns for the Gamma REST API (no SDK exists).

2.8K 0
View
deepgram-sdk-patterns logo
jeremylongshore/claude-code-plugins-plus-skills

deepgram-sdk-patterns

Apply production-ready Deepgram SDK patterns for TypeScript and Python.

2.8K 0
View
openrouter-upgrade-migration logo
jeremylongshore/claude-code-plugins-plus-skills

openrouter-upgrade-migration

Migrate to OpenRouter from direct provider APIs or upgrade between SDK/model

2.8K 0
View
openrouter-common-errors logo
jeremylongshore/claude-code-plugins-plus-skills

openrouter-common-errors

Diagnose and fix common OpenRouter API errors. Use when encountering

2.8K 0
View
linear-cost-tuning logo
jeremylongshore/claude-code-plugins-plus-skills

linear-cost-tuning

Optimize Linear API usage, reduce unnecessary calls, and maximize

2.8K 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View