Ensure your site handles traffic spikes
Stress Test Your Website
Push your website to its limits with realistic user simulations. Identify the breaking point of your infrastructure and fix issues before peak traffic events hit.
Simulate real browser-like HTTP requests
Test landing pages, checkouts, and user flows
Identify server bottlenecks under load
Monitor response times and error rates in real-time
The stress profile steps the rate up until a threshold breaks
Reports the knee: the last rate that met your thresholds
stress-test.js
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
stages: [
{ duration: '1m', target: 50 }, // Ramp up
{ duration: '3m', target: 200 }, // Peak load
{ duration: '1m', target: 0 }, // Ramp down
],
};
export default function () {
const res = http.get('https://mysite.com');
check(res, {
'page loads': (r) => r.status === 200,
'fast response': (r) => r.timings.duration < 1000,
});
sleep(Math.random() * 3);
}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.