How do you make load tests behave more like real users?

November 17, 2026 5 answers
Asked by 7h+ferronix_302

Our current test ramps up to 10,000 users in a minute and tends to exhaust connection pools. How can we model gradual traffic and user pauses without creating bottlenecks that don't reflect normal use?

Answers

a.517!quillon

Start with a warm-up at a fraction of the target load, then ramp up in stages and hold each stage long enough to see how the system behaves. Ramp down afterwards too.

Give users pauses between actions, with some variation rather than the exact same sleep every time. A tool like k6 can script both the stages and the user flows. Keep a separate spike test if sudden arrivals are a scenario you care about, but don't confuse its results with steady traffic.

Reply to this answer
_u38~plover-gasket.6

I'd build the workload from the traffic footprint rather than starting with a round number of users. Look at normal and peak requests per second, endpoint mix, session length, concurrency and time between actions. Also check the read and write mix. A script that writes on every request can put a very different load on the database than actual traffic.

If traffic mirroring is available, that may be an option for exercising representative requests. Otherwise, analyze the traffic patterns and rebuild the flows in your test.

Reply to this answer
Vaskeli.3q

Watch the load model as well as the ramp. In a closed model, each simulated user waits for an iteration to finish before starting another. If the app slows down, the test can quietly send fewer requests, which may hide how bad things get under continued arrivals.

An arrival-rate model schedules new iterations at a configured rate instead. In k6, ramping-vus and ramping-arrival-rate are examples of those two approaches. Pick the one that fits the question you're testing, and check that the load generator can actually sustain the intended rate.

Reply to this answer
b.719!velourcaddy

Warm and cold behavior are different tests. Let caches populate and allow instances to start up before measuring a warmed workload, then run a separate cold-start or parallel start-up test if that matters for your service. The cold failures aren't necessarily useless, they just answer a different question.

Reply to this answer
_h93!mavilo.7

If Python is more comfortable for your team, Locust is another option. You can script user activity and configure the rate at which users are added, then watch where performance starts to fall off as load increases.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions