Index of every page on this site: llms.txt
All skills
Run it yourself

Execute comprehensive load and stress testing to validate API performance and scalability. Use when validating API performance under load. Trigger with phrases like "load test the API", "stress test API", or "benchmark API performance".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/load-testing-apis

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesexamples.md

≈979 tokens on demand. Your agent reads this file only when SKILL.md points to it.

API Load Testing Examples

k6 Baseline Load Test

// load-tests/scenarios/baseline.js
import http from 'k6/http';
import { check, sleep } from 'k6';

export const options = {
  stages: [
    { duration: '2m', target: 50 },
    { duration: '10m', target: 50 },
    { duration: '2m', target: 150 },
    { duration: '2m', target: 0 },
  ],
  thresholds: {
    http_req_duration: ['p(95)<500', 'p(99)<1000'],
    http_req_failed: ['rate<0.01'],
    http_reqs: ['rate>100'],
  },
};

const BASE_URL = __ENV.BASE_URL || 'http://localhost:3000';
const TOKEN = __ENV.API_TOKEN;

export default function () {
  const headers = { Authorization: `Bearer ${TOKEN}` };

  if (Math.random() < 0.7) {
    const res = http.get(`${BASE_URL}/api/products?page=1&limit=20`, { headers });
    check(res, { 'products 200': (r) => r.status === 200 });
  } else if (Math.random() < 0.67) {
    const id = Math.floor(Math.random() * 100) + 1;
    http.get(`${BASE_URL}/api/products/${id}`, { headers });
  } else {
    http.post(`${BASE_URL}/api/orders`,
      JSON.stringify({ productId: 1, quantity: 1 }),
      { headers: { ...headers, 'Content-Type': 'application/json' } });
  }
  sleep(Math.random() * 3 + 1);
}

k6 Spike Test

export const options = {
  stages: [
    { duration: '1m', target: 50 },
    { duration: '30s', target: 1000 },
    { duration: '2m', target: 1000 },
    { duration: '30s', target: 50 },
    { duration: '2m', target: 50 },
  ],
  thresholds: {
    http_req_duration: ['p(95)<2000'],
    http_req_failed: ['rate<0.05'],
  },
};

k6 Soak Test

export const options = {
  stages: [
    { duration: '5m', target: 200 },
    { duration: '4h', target: 200 },
    { duration: '5m', target: 0 },
  ],
  thresholds: {
    http_req_duration: ['p(95)<500'],
    http_req_failed: ['rate<0.01'],
  },
};

Artillery Configuration

config:
  target: "http://localhost:3000"
  phases:
    - duration: 120
      arrivalRate: 10
      name: "Warm up"
    - duration: 600
      arrivalRate: 50
      name: "Sustained"
    - duration: 120
      arrivalRate: 150
      name: "Spike"
  defaults:
    headers:
      Authorization: "Bearer {{ $processEnvironment.API_TOKEN }}"
scenarios:
  - name: "Browse and purchase"
    flow:
      - get:
          url: "/api/products?page=1&limit=20"
          expect: [{ statusCode: 200 }]
      - think: 2
      - post:
          url: "/api/orders"
          json: { productId: "{{ $randomNumber(1, 50) }}", quantity: 1 }
          expect: [{ statusCode: 201 }]

Running Tests

# k6 baseline
k6 run load-tests/scenarios/baseline.js \
  --env BASE_URL=http://staging.example.com \
  --env API_TOKEN=test_token_123

# Artillery
npx artillery run load-tests/scenarios/artillery-baseline.yml \
  --output reports/results.json
npx artillery report reports/results.json --output reports/report.html

# Quick wrk smoke test
wrk -t4 -c10 -d30s -H "Authorization: Bearer $TOKEN" http://localhost:3000/api/products

Threshold Configuration

{
  "slo": {
    "availability": 0.999,
    "latency": { "p50": 100, "p95": 500, "p99": 1000 },
    "throughput": { "minimum_rps": 100 },
    "error_rate": { "maximum": 0.01 }
  }
}

Performance Report

## Baseline (50 VUs, 10 min)
| Metric | Result | SLO | Status |
|--------|--------|-----|--------|
| p50 latency | 45ms | <100ms | PASS |
| p95 latency | 230ms | <500ms | PASS |
| p99 latency | 680ms | <1000ms | PASS |
| Error rate | 0.2% | <1% | PASS |
| Throughput | 340 rps | >100 rps | PASS |

## Bottleneck: Database connection pool
At 500+ VUs, p99 spikes to 4200ms. PostgreSQL max_connections saturated at 100.
Recommendation: Increase pool to 200, add PgBouncer.

Tons of Skills by Intent Solutions | jeremylongshore.com

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts27d3 checks · Risk SAFE
  • Gen Agent Trust Hub27d

    The skill automates API load testing by generating and executing scripts for tools like k6 and Artillery. It analyzes API specifications to determine endpoints and test logic. Security considerations include the risk of indirect prompt injection from untrusted API definitions and the execution of dynamically generated scripts.

  • Socket27d

    No alerts

  • Snyk27d

    Risk: LOW · No issues

Signed by skilld at 820dfc8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
What it can do
Reads files Edits files Runs commands
version
1.25.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "api",
  "testing",
  "performance",
  "scaling"
]
All 6 allowed tools
ReadWriteEditGrepGlobBash(api:load-*)
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/load-testing-apis