# Load Testing

> Designs and executes load, stress, and soak tests. Covers target definition, realistic traffic simulation, bottleneck identification, and capacity planning. Use when validating system performance under load or planning for traffic growth.

- **Type:** Skill
- **Install:** `agentstack add skill-pvnarp-agent-skills-load-testing`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [pvnarp](https://agentstack.voostack.com/s/pvnarp)
- **Installs:** 0
- **Category:** [Cloud & Infrastructure](https://agentstack.voostack.com/c/cloud-infrastructure)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [pvnarp](https://github.com/pvnarp)
- **Source:** https://github.com/pvnarp/agent-skills/tree/main/skills/load-testing

## Install

```sh
agentstack add skill-pvnarp-agent-skills-load-testing
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Load Testing

"Works on my machine" is not a performance guarantee. Load testing answers: "will it work when 1000 users hit it at once?"

## Types of Load Tests

| Type | Purpose | Pattern |
|------|---------|---------|
| **Load test** | Does it handle expected traffic? | Ramp to target RPS, hold for 10-30 min |
| **Stress test** | Where does it break? | Ramp until failure, note the breaking point |
| **Soak test** | Does it leak resources over time? | Normal load for 4-24 hours |
| **Spike test** | Does it handle sudden bursts? | Sudden jump to 5-10x normal, then back down |
| **Breakpoint test** | What's the absolute max? | Incrementally increase until system fails |

## Step 1: Define Targets

Before writing tests, define what "good" looks like:

```
TARGET SCENARIO: [what you're simulating]
EXPECTED USERS: [concurrent users]
EXPECTED RPS: [requests per second]
ACCEPTABLE LATENCY: p50  r.status === 200,
    'response time  r.timings.duration  1% |
| CPU utilization | Server monitoring | > 80% sustained |
| Memory usage | Server monitoring | Growing without stabilizing |
| Database connections | DB monitoring | Pool exhausted |
| Queue depth | Queue monitoring | Growing (consumers can't keep up) |
| Disk I/O | Server monitoring | Saturated |
| Network throughput | Server monitoring | Bandwidth cap hit |

## Step 5: Analyze Results

### Finding Bottlenecks

```
Is latency increasing with load?
  → YES at low concurrency: Application bottleneck (slow code, N+1 queries)
  → YES at high concurrency: Resource saturation (CPU, memory, connections)
  → NO: System is handling the load well

Is error rate increasing with load?
  → 5xx errors: Server overwhelmed (timeouts, OOM, connection exhaustion)
  → 429 errors: Rate limiting (increase limits or optimize client)
  → Connection errors: Network or load balancer limits
```

### Common Bottlenecks

| Bottleneck | Symptom | Fix |
|-----------|---------|-----|
| Database queries | Latency spikes, connection pool exhausted | Add indexes, optimize queries, connection pooling |
| No connection pooling | New TCP connection per request | Use connection pool for DB, HTTP clients |
| Synchronous I/O | Threads blocked, low throughput | Async I/O or increase thread pool |
| Single instance | CPU maxed on one server | Horizontal scaling, load balancer |
| Missing cache | Same expensive computation repeated | Add caching layer |
| Large payloads | Network bandwidth saturated | Compress, paginate, reduce payload |
| Lock contention | Threads waiting on shared resources | Reduce critical section, use optimistic locking |

## Step 6: Report

```
## Load Test Report

### Test Configuration
- Target: [X] concurrent users / [X] RPS
- Duration: [X] minutes
- Environment: [staging, production-mirror]
- Date: [YYYY-MM-DD]

### Results
| Metric | Target | Actual | Status |
|--------|--------|--------|--------|
| p50 latency | < 200ms | 180ms | PASS |
| p95 latency | < 500ms | 620ms | FAIL |
| p99 latency | < 1000ms | 2400ms | FAIL |
| Error rate | < 1% | 0.3% | PASS |
| Max RPS achieved | 500 | 420 | FAIL |

### Bottlenecks Identified
1. [Bottleneck] - [evidence] - [recommended fix]

### Recommendations
1. [Action] - [expected improvement]

### Next Steps
- [ ] Fix identified bottlenecks
- [ ] Re-run test to verify improvements
- [ ] Schedule soak test for [date]
```

## When to Run Load Tests

| Trigger | Test Type |
|---------|-----------|
| Before launch | Full load + stress + soak |
| Before major feature release | Load test for affected endpoints |
| Before expected traffic spike | Load test at expected peak |
| After significant architecture change | Full load test |
| Quarterly (routine) | Soak test (catch resource leaks) |

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [pvnarp](https://github.com/pvnarp)
- **Source:** [pvnarp/agent-skills](https://github.com/pvnarp/agent-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-pvnarp-agent-skills-load-testing
- Seller: https://agentstack.voostack.com/s/pvnarp
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
