Capacity Planning and Load Testing with k6
Learn to load test services with k6, find the real bottleneck, and turn results into a 12 month capacity plan tied to your SLOs.
What You'll Learn
Understanding Why Capacity Planning Starts With a Failure
The night the booking page fell over Capacity problems are never discovered in a meeting.
Understanding Load, Stress, Soak, and Spike Tests
What each test type finds Each type of load test answers a different question, so running only one gives you a false sense of safety.
Writing Your First k6 Load Test
How to install and run k6 k6 is an open source load testing tool from Grafana Labs.
Tying Thresholds to SLOs
Turning an SLO into a k6 threshold A threshold is a pass or fail rule inside the test.
Finding the Bottleneck
Use the USE method on every resource When latency rises under load, something is saturated.
Planning Headroom and Autoscaling Limits
How much headroom to keep Headroom is the gap between your peak traffic and the tested limit.
Skills You'll Master
Curriculum Index10 topics
Understanding Why Capacity Planning Starts With a Failure
The night the booking page fell over Capacity problems are never discovered in a meeting.
Understanding Load, Stress, Soak, and Spike Tests
What each test type finds Each type of load test answers a different question, so running only one gives you a false...
Writing Your First k6 Load Test
How to install and run k6 k6 is an open source load testing tool from Grafana Labs.
Tying Thresholds to SLOs
Turning an SLO into a k6 threshold A threshold is a pass or fail rule inside the test.
Finding the Bottleneck
Use the USE method on every resource When latency rises under load, something is saturated.
Planning Headroom and Autoscaling Limits
How much headroom to keep Headroom is the gap between your peak traffic and the tested limit.
Forecasting Growth From Metrics
Measure the right traffic number A forecast is only as good as its input.
Building a 12 Month Capacity Plan
A worked example Take the cart service. Today's peak is 1,200 requests per second, and traffic has been growing about 8...
Running the Lab: Break a Service, Find the Limit, Fix It
Lab overview You will run a small API whose database connection pool is deliberately too small.
Quick Reference and Common Mistakes
Quick reference Common mistakes Testing with a closed model is the most common one.
Career Impact
Roles that use the skills in this module.
Site Reliability Engineer
DevOps Engineer
Platform Engineer
Next Modules
Related Guides
Practice on the Coding Sheet
Not a software engineer sheet. Every problem comes from real DevOps, SRE, Platform and Cloud interviews, from your first script to a system you build yourself.
Open the Coding SheetFrequently Asked Questions
A load test applies the traffic you expect, such as a normal peak, to check that the service meets its SLO. A stress test keeps pushing past that point until something breaks, so you learn the real limit and how the service fails. You need both: the first proves you are safe today, the second tells you how much room you have.
Arrival-rate executors start new requests at a fixed rate whether or not earlier requests have finished. This copies real users, who do not wait politely for a slow server. Fixed-user (closed model) tests slow down automatically when the server slows down, which hides the overload you are trying to find.
A common starting point is to run at no more than 60 to 70 percent of the tested limit at peak. The rest absorbs traffic spikes, a lost zone or node, and slow scale-up. Tighten or loosen the number based on how fast you can add capacity and how costly an outage is.
You can, but only with care: low and ramped traffic, test accounts, no real payments or emails, and a kill switch. Most teams run full-scale tests in a production-like staging environment and use small, controlled tests in production. Never run your first stress test against production.
No. Autoscaling reacts to load, but it is limited by scale-up delay, node availability, quotas, and downstream limits such as database connections. Capacity planning sets the safe ceiling and the minimum baseline that autoscaling works within.