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);
}At minimum 15-30 minutes to detect most issues. For production validation, 1-4 hours is ideal. The Pro plan supports 15-minute tests; Business supports up to 60 minutes.
Memory leaks, connection pool exhaustion, disk space fill-up, log rotation failures, cache eviction problems, and gradual response time degradation that only appears under sustained load.
Stress test your website with up to 200 virtual users for free. Find performance bottlenecks and ensure your site handles traffic spikes.
Test how your application handles sudden traffic spikes. Simulate flash sales, viral moments, and DDoS-like scenarios safely.
Use load testing for infrastructure capacity planning. Determine how many users your servers can handle and when to scale.