Find issues that only appear over time
Soak Testing
Run tests for extended periods to uncover problems that don't surface in short bursts โ memory leaks, connection pool exhaustion, database connection limits, and gradual performance degradation.
Extended test durations (15-60 minutes)
Memory leak detection through metric trends
Connection pool exhaustion testing
Gradual performance degradation monitoring
Resource utilization tracking
Ideal for pre-release validation
soak-test.js
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
stages: [
{ duration: '2m', target: 100 }, // Ramp up
{ duration: '30m', target: 100 }, // Sustained load
{ duration: '2m', target: 0 }, // Ramp down
],
thresholds: {
http_req_duration: ['p(95)<500'], // Should stay consistent
http_req_failed: ['rate<0.01'],
},
};
export default function () {
http.get('https://myapp.com/api/data');
sleep(2);
}Frequently asked questions
Related guides
Run this as a plan
Put the scenario in your app's Config/load-plan.json and run it from the narduk-app CLI.