Know your limits before your users find them
Capacity Planning
Use systematic load testing to determine your infrastructure's capacity. Find out exactly how many concurrent users your app can handle, at what point performance degrades, and when you need to scale.
Progressive load testing methodology
Identify exact breaking points
Cost-per-user infrastructure analysis
Auto-scaling validation
Baseline establishment for monitoring
Data-driven scaling decisions
capacity-test.js
import http from 'k6/http';
import { check, sleep } from 'k6';
// Gradually increase load to find the breaking point
export const options = {
stages: [
{ duration: '2m', target: 50 },
{ duration: '2m', target: 100 },
{ duration: '2m', target: 150 },
{ duration: '2m', target: 200 }, // Free tier max
],
thresholds: {
http_req_duration: ['p(95)<1000'],
http_req_failed: ['rate<0.05'],
},
};
export default function () {
http.get('https://myapp.com');
sleep(1);
}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.