Skip to main content

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.

~3 hours
10 Topics
Hands-on Scenarios

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

SREK6LOAD-TESTINGCAPACITY-PLANNINGSLO

Curriculum Index10 topics

Career Impact

Roles that use the skills in this module.

  • Site Reliability Engineer

  • DevOps Engineer

  • Platform Engineer

See how this is asked in interviews

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 Sheet

Frequently 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.