devxlogo

How to Run Load Tests That Reflect Real Users

How to Run Load Tests That Reflect Real Users
How to Run Load Tests That Reflect Real Users

Most load tests fail in a very specific, very predictable way. They test your system the way your load testing tool behaves, not the way your users behave.

Real users do not hit “login” 10,000 times a second in perfect unison. They bounce, they scroll, they stall on flaky mobile networks, they retry after a spinner, and they take detours you did not design for. If your test ignores those behaviors, the results can look comforting while your on call reality stays spicy.

Realistic load tests reproduce how users arrive, what they do next, how long they pause between actions, what devices and networks they bring, and the messy distribution of normal versus heavy users. Once you model those five things, your test stops being a vanity benchmark and starts being a prediction.

Start by stealing reality from production, not from your imagination

When you look past marketing blog posts and dig into systems research and practitioner guidance, a few themes show up consistently.

Bianca Schroeder, Professor at Carnegie Mellon University, has shown through systems research that the choice of workload model alone can change the performance story you observe. Two tests with the same average load can produce very different results depending on whether arrivals are fixed or tied to system response time. The quiet lesson is that your load generator’s assumptions are not neutral.

Engineers behind Mozilla’s developer documentation draw a sharp distinction between synthetic testing and real user monitoring. Synthetic tests are controlled and repeatable, which makes them great for regression detection. Real user monitoring reveals how actual devices, networks, and geographies behave over time. The practical takeaway is that you learn from real users first, then replay those patterns synthetically.

Teams building large-scale test tooling like Gatling make the same point from the trenches. They emphasize that arrival-based models and concurrency-based models are not interchangeable abstractions. One describes how traffic shows up, the other describes how many users are allowed to exist at once.

See also  DevEx as a Driver of Company Efficiency: An Interview with Artem Mukhin

Put together, these perspectives point to a grounded strategy. Use production telemetry to learn how people behave, then choose a workload model that matches how your traffic actually arrives.

Choose the workload model carefully, because this is where realism usually dies

Many teams default to a fixed number of concurrent virtual users because it feels intuitive. The problem is subtle. In a concurrency-based model, request rate is coupled to system speed. When the system slows down, fewer requests are sent. That can hide the very overload conditions you are trying to uncover.

Arrival-based models decouple the arrival rate from the response time. Users keep showing up, whether your backend is happy or not. For consumer-facing systems, this usually mirrors reality more closely.

A simple rule of thumb works well in practice.

If you are modeling users who arrive whenever they want, such as marketing traffic, browsing flows, or search-driven entry points, use an arrival-based model.

If you are modeling a fixed pool of workers or terminals, such as agents in a call center or batch processors, concurrency-based models can make sense.

If you are unsure, run both. When they disagree dramatically, you have discovered a queueing sensitivity worth investigating before production finds it for you.

Build a user behavior model, not a list of endpoints

Realistic tests almost always look like small probabilistic state machines, not linear scripts.

You want to capture common journeys like browse to view to add to cart to checkout. You want to assign probabilities because most users do not complete the happy path. You want to think time between actions because humans read and hesitate. You want realistic payloads such as real product IDs and plausible cart sizes. You also want failure behavior like retries, refreshes, and repeated clicks when something feels stuck.

If you have analytics or tracing, extract the top journeys and approximate the long tail. If you do not, start with access logs grouped by session and validate your assumptions over time.

See also  How to Implement Event Driven Workflows with Message Queues

This is where real user monitoring earns its keep. It teaches you what devices and networks your users actually bring, and synthetic tests let you replay those conditions consistently.

A worked example that is usually accurate enough to be useful

Assume you see 50,000 sessions per day.

Analytics show that about 8 percent of sessions happen in the busiest hour. Average session duration is six minutes. Each session generates about twelve requests spread across that time.

Peak hour sessions are 50,000 times 0.08, or 4,000 sessions per hour. That is about 1.1 sessions per second.

Average session length is 360 seconds. Multiply the arrival rate by duration, and you get roughly 400 concurrent active sessions.

Each session makes twelve requests over 360 seconds, or about 0.033 requests per second per session. Multiply by 400 sessions, and you land at roughly 13 requests per second on average.

The number itself is not the point. What matters is what you do next. Apply a burst factor to reflect intra-hour spikes. Split traffic across endpoints based on journey probabilities. Run the test as an arrival-based model so pressure does not evaporate when the system slows down.

Even if your assumptions are off by a wide margin, you are now anchored to user behavior instead of guesswork.

Implement with tools that can express arrivals, journeys, and data

Realistic tests need scenario composition, arrival rate control, parameterized data, and clear metrics.

Tools like Grafana k6 excel at arrival-based scenarios and readable scripting. Teams sometimes miss front-end bottlenecks if they stay purely at the HTTP layer.

Gatling shines at open workload modeling and high throughput protocol testing, though some teams find the Scala-based approach unfamiliar at first.

Locust offers Python-based behavior modeling that is flexible for complex states, but it is easy to accidentally create unrealistic think times if you are not careful.

JMeter remains common in enterprises with its large plugin ecosystem, but thread-based tests can skew realism unless you invest time in careful modeling.

See also  PostgreSQL vs MySQL: Key Production Differences

A strong pattern is to combine layers. Use protocol-level load for scale and cost efficiency, then add a smaller browser-level slice for the journeys where front-end work dominates user experience.

Validate realism by comparing distributions, not averages

If you want to know whether your test reflects real users, stop staring at means.

Compare arrival curves and spike shapes. Check whether the endpoint mix matches production. Look at latency percentiles, especially p95 and p99. Watch for error modes and retry patterns that resemble what you see in the wild.

Then iterate. Update journey probabilities as features ship. Refresh data sets. Recheck device and network distributions as your audience evolves.

FAQ

Do I need real user monitoring to do realistic load tests?

You can start without it, but it dramatically reduces guesswork, especially for device, geography, and network variability.

Why do fixed virtual user tests look fine while production melts?

Because many of those tests reduce pressure as the system slows down. Arrival-based models keep the pressure constant.

Should I test with browsers or just HTTP?

For most teams, mostly HTTP for scale, plus a small browser layer for critical journeys, is the best balance.

Honest Takeaway

The hard part of realistic load tests are not the tool. It is the discipline of modeling arrivals and journeys honestly, then keeping that model current as your product changes.

Anchor your tests to production reality, prefer arrival-based models for user-driven systems, and validate realism by comparing distributions instead of averages. Do that, and your next “it was fine in staging” incident will be shorter, calmer, and much rarer.

steve_gickling
CTO at  | Website

A seasoned technology executive with a proven record of developing and executing innovative strategies to scale high-growth SaaS platforms and enterprise solutions. As a hands-on CTO and systems architect, he combines technical excellence with visionary leadership to drive organizational success.

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.