Load Testing: The Complete Guide to Tools, Scripting, and Automating It

Load Testing with tools, metrics and examples | TestWheel

Quick answer: Load testing is a type of performance testing that simulates the number of concurrent users and requests you expect in production, then measures response time, error rate, and resource use. It shows whether your app meets its targets under normal and peak traffic before real customers find out.

Your launch email goes out at 9 a.m. By 9:04, the checkout button is just… spinning. Nothing in the code is “broken.” The app was never tested with that many people at once.

That is the exact problem load testing solves. In this guide, you get the definition, the math for sizing virtual users, a copy-paste k6 script, and a GitHub Actions workflow that runs it on autopilot. We skip the basics our Non-functional testing and performance testing guide already covers (the full types list, the metrics table, the cloud-vs-on-prem comparison) and link out instead, so you only read the new stuff.

Key takeaways

  • Goal: prove your app meets its targets at expected and peak traffic, not just on a quiet Tuesday.
  • Pass/fail numbers: tail latency (p95 or p99), error rate, throughput, and saturation.
  • Sizing: virtual users ≈ iterations per second × iteration duration (Little’s Law).
  • Workload model: use an open (arrival-rate) model for public traffic so a slow server can’t quietly lower your load.
  • Automation: run a tiny smoke test on every pull request, bigger runs on a schedule, and let thresholds fail the build.

Load Testing: How it works? 

Load testing sends a controlled crowd of virtual users to your app and watches how it holds up. A virtual user (VU) is a script that acts like a person: it opens pages, calls APIs, and pauses between clicks. You ramp the crowd up, hold it, ramp it down, and compare the results with your targets.

Why now? Online shopping is expected to reach record levels during Cyber Monday; businesses need to prepare their websites for sudden traffic increases. These four simple steps will help you run a load test before the peak shopping season. 

A tax example makes it real. Around the April filing deadline, millions of people hit online tax tools within a few days. If the site slows down or fails transactions, people notice fast. That kind of seasonal rush is why businesses perform load testing in advance. It helps identify performance bottlenecks and prepare applications to handle increased traffic without disrupting users. 

Here’s a quick breakdown of the different types of performance testing, based on established testing practices:

Test What it checks Load level
Smoke Does the script work at all? Very low
Load Is it fast on a normal or busy day? Expected traffic
Stress Where does it break? Above expected
Soak Does it stay healthy for hours? Normal, for a long time

Why is load testing important for application performance? See our performance testing guide.

Which Numbers Decide Pass or Fail?

Pass/fail numbers are limits you write down before the test, so the result is a fact and not a feeling.

• Response time (use p95 or p99). p95 means 95 out of 100 requests finished faster than that number. If p95 is 500 ms, five requests in 100 were slower. Skip the plain average. It can look great while your slowest users wait much longer.
• Error rate. The share of requests that fail, such as HTTP 5xx errors.
• Throughput. How many requests the app handles per second.
• Server strain. CPU, memory, and database connections. When one maxes out, everything slows down.

Example targets: p95 under 500 ms and errors under 1% at expected traffic. Set your own targets based on your users and your service-level agreement (SLA).

How Many Virtual Users Do You Need?

Little’s Law is a queueing theory principle used to calculate the average number of users in a system based on the arrival rate and the time each user spends there. It helps performance testers estimate how many virtual users are required to simulate expected traffic. 

Formula: Virtual users = actions per second × seconds per action (including pauses)

Example (fixed-user test with think time): Peak is 100 actions per second. Each action takes 0.5 s of requests plus 5.5 s of “reading” time, so 6 s total. 100 × 6 = 600 virtual users. Add approximately 20% extra virtual users as a buffer to account for unexpected traffic increases and variations in response times. 

Quick peak-hour estimate: Concurrent users ≈ sessions per hour × average session seconds ÷ 3,600. For 990 sessions at 92 seconds each, that is about 25 people on the site at once.

Fixed users or arrival rate?

With a fixed pool of users, a slow server makes each iteration take longer, so fewer new iterations start, and you send less load exactly when the system struggles. k6 calls this the closed model and explains the problem. The fix is the open model: start new iterations at a fixed rate no matter how the server responds. In k6, that is the ramping-arrival-rate executor.

Catch: In arrival-rate mode, do not add sleep() at the end of the script. The executor already sets the pace, per the same docs. Add pauses only if one iteration is meant to be a full user session.

How to Run a Load Test In 4 Simple Steps

Picture your online store the night before Cyber Monday. A load test shows you how your site holds up when the crowd arrives, before real customers find out for you. Adobe expects Cyber Monday 2026 to be the first single day of U.S. online shopping to pass $15 billion (Adobe, 2026), and that day falls on November 30. Spikes like this are exactly what load testing prepares you for. These 4 simple steps will help you run a Load Test easily; keep reading to learn!

1.  Plan for your busiest hour, not your average day. Check analytics for your peak hour and estimate users with the formula above.
2.  Write pass/fail rules first. For example, p95 under 500 ms and errors under 1%. In k6 these are called thresholds. If one fails, the run exits with an error, so a pipeline can stop the release.
3.  Ramp up gradually. Do a quick smoke test first to confirm the script works, then raise the load to target, hold it, and ramp down.
4.  Record, fix one thing, rerun. Note the load level where things broke and why. Change one thing, rerun the same test, and compare.

Try it: a k6 script you can copy

Save as load-test.js and run k6 run load-test.js. Point it at your own staging site. The demo URL is fine for practice, but never test a site you do not own.

  • Scenarios: start at 2 iterations per second, climb to 20, hold for 10 minutes, drop to 0 (13 minutes total).
  • Thresholds: your pass/fail rules.
  • PreAllocatedVUs / maxVUs: the user pool. Quick check: 20 iterations per second × about 0.5 s each ≈ 10 busy users, so 20 to start and 50 as a ceiling leaves breathing room.

Which load testing tool should you use?

  • k6: free, open source, scripts in JavaScript. Good for teams that code.
  • Apache JMeter: free, wide protocol support.
  • Gatling: tests written as code.
  • TestWheel: no-code. You set up HTTP load tests in the cloud and read reports on throughput, errors, and responsiveness. It is HTTP-focused, so databases and queues need a specialist tool. Start a free trial on the performance testing page.

For a side-by-side, see our performance testing tools comparison.

Run it automatically with GitHub Actions

Grafana publishes two official actions: setup-k6-action installs k6 and run-k6-action runs your script. Add this as .github/workflows/load-test.yml:

Run it automatically with GitHub Actions | TestWheel

Pull requests run a tiny smoke-test.js (for example, 5 users for 30 seconds). Scheduled and manual runs use the full 13-minute load-test.js. If a threshold fails, the step fails, and the pull request is blocked. Always point it at staging, never production. k6’s guide on automated performance testing recommends mixing CI runs, scheduled runs, and manual runs.

Try automated performance testing with more ease.

When results look bad

What you see Likely cause
Slow responses while CPU stays low A connection pool or thread pool is full
Memory climbs steadily in the long run Memory leak
Errors start at a fixed request rate Rate limit or third-party cap
Results change when you switch machines The load generator is the bottleneck

Do not run big tests from your laptop. Wi-Fi, specs, and distance from the server skew the numbers. Use a dedicated machine.

Common mistakes: Judging by the average, testing from a weak machine, and aiming a test at production or at a site you do not own.

Ready to Run Your First Load Test?

Start load testing today to see how your application performs under real-world traffic conditions. Whether you choose k6 for script-based testing or a no-code platform like TestWheel, regular load testing helps identify performance bottlenecks, improve application reliability, and prepare your website for unexpected traffic spikes.

Ready to get started? Try TestWheel with a free trial or request a demo today!

Frequently Asked Questions

Load testing checks that your app meets its targets under expected traffic. Stress testing pushes past that to find where it breaks and whether it recovers afterward.

Calculate it with Little’s Law: target actions per second × seconds per action, including pauses. Then add 20 to 30% headroom.

Use Little’s Law: multiply your target actions per second by the average time a single action takes (including user “think time” pauses). For example, 50 requests per second where each user session takes 4 seconds requires 200 concurrent virtual users, plus a 20–30% buffer for latency spikes.

While targets depend on your Service Level Agreements (SLAs), a strong baseline for web applications and APIs is a p95 response time under 500 ms, an error rate below 1%, and CPU/memory utilization staying below 75–80% during peak traffic.

Yes. While developer-centric tools like k6 and Locust rely on JavaScript or Python scripts, no-code cloud platforms like TestWheel allow teams to configure virtual users, loops, and HTTP endpoints through a visual interface.

Non-functional. It checks how fast and reliable the app is under traffic, not whether a feature works. See our non-functional testing guide.

Written By
Kanagaraj VS
Follow me on

Speed Up Your Entire
Testing Process

With AI-powered, no-code automation for web, API, mobile and load testing, achieve faster releases with fewer bugs and full compliance.

Schedule a Demo