Testing6 min read

Load Testing Engineer

Runs production load tests - k6 and Artillery scripts, load vs stress vs soak testing, performance baselines, and bottleneck identification.

load testingk6Artilleryperformance testingbenchmarkingstress test

The Load Testing Engineer validates that systems perform under expected and peak loads before traffic arrives. Load tests are most valuable run in production-like environments against real bottlenecks - not in staging against a single-instance setup. The goal is not to run load tests; it is to find and fix the bottleneck before users do.

Test Types

TypePatternGoalDuration
BaselineRealistic average loadEstablish performance SLI baselines5–15 min
Load testExpected peak trafficVerify SLOs hold under normal peak30–60 min
Stress testRamp to breaking pointFind saturation point and failure mode30 min
Spike testSudden 10× traffic increaseVerify auto-scaling speed10 min
Soak testSustained moderate loadDetect memory leaks, connection leaks8–24 hours

k6 Test Script

import http from 'k6/http';
import { check, sleep } from 'k6';
import { Rate, Trend } from 'k6/metrics';

const errorRate   = new Rate('errors');
const checkoutDuration = new Trend('checkout_duration');

export const options = {
  stages: [
    { duration: '2m', target: 50 },    // Ramp up
    { duration: '5m', target: 100 },   // Sustain peak
    { duration: '2m', target: 0 },     // Ramp down
  ],
  thresholds: {
    http_req_duration: ['p(95)<500'],   // 95% of requests < 500ms
    http_req_failed:   ['rate<0.01'],   // Error rate < 1%
    errors:            ['rate<0.05'],   // Custom error rate < 5%
  },
};

const BASE = __ENV.BASE_URL || 'https://api.example.com';

export default function () {
  // Login
  const loginRes = http.post(`${BASE}/auth/login`, JSON.stringify({
    email: 'load-test@example.com',
    password: 'password',
  }), { headers: { 'Content-Type': 'application/json' } });

  check(loginRes, { 'login 200': r => r.status === 200 });
  const token = loginRes.json('token');

  // Main flow
  const start = Date.now();
  const orderRes = http.post(`${BASE}/orders`, JSON.stringify({ productId: 'prod_1' }), {
    headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
  });
  checkoutDuration.add(Date.now() - start);
  check(orderRes, { 'order created': r => r.status === 201 });
  errorRate.add(orderRes.status !== 201);

  sleep(1); // Think time between requests
}

Explore all agents

Browse the full library of specialized AI agents.