loading…

Loading…

Notes

POST API load test — when to use

Registration endpoints, general POST load testing, and setting performance baselines. Expect ~100% checks passing with p(95) comfortably under the 500ms threshold on a healthy API.

GET API stress test — when to use

Finding system capacity limits, stress testing read-heavy APIs, and performance regression testing. Watch p(99) specifically — it's usually the first percentile to blow past its threshold as load climbs.

Spike test — when to use

Testing auto-scaling behavior, rate-limit validation under sudden load, and traffic-surge preparation (a product launch or a Black Friday). Some check failures during the spike itself are expected, not a bug in the test.

Authentication flow — when to use

Login/signup flow testing, JWT token handling, and session-based API load testing where every request needs to carry a valid Authorization header.

Multi-endpoint scenario — when to use

E-commerce flow testing, user-journey validation, and integration testing under load — anywhere the thing you care about is a sequence of requests staying fast together, not any single endpoint in isolation.

Rate limiting validation — when to use

Validating rate-limit configuration, testing throttling mechanisms, and API quota testing. A healthy result shows 429s appearing right around your configured limit, not noticeably before or after it.

GraphQL query load test — when to use

GraphQL API load testing, complex nested-query performance, and N+1 query problem detection — the deep nesting in the query is what actually exercises resolver performance, not the load profile.

File upload performance — when to use

Document/image upload endpoints, large-file handling, and multipart form data testing. Expect http_req_sending to dominate the timing breakdown here, unlike the other scripts where http_req_waiting usually does.

Reading the output

p(95) and p(99) matter more than the average — a fast average with a bad p(99) means most users are fine but a real slice are having a noticeably worse time. http_req_waiting (time to first byte) vs http_req_sending/receiving tells you whether latency is server-side thinking time or actual data transfer.

Threshold starting points

Rough defaults if you don't have your own SLA yet: p(95) < 500ms for typical API endpoints, < 200ms for database-backed queries, < 3000ms for file uploads, < 2000ms for complex report generation. Tighten these once you know your actual baseline.

What is K6?

K6 is a modern, developer-friendly load testing tool built for testing the performance of APIs, microservices, and websites. Write tests in JavaScript and run them from the CLI or CI/CD pipeline.

Run With Custom Load

Any script in the file browser above is run the same way — build the k6 run invocation once here instead of re-typing flags for each one.