What Is Load Testing and How Many Users Should You Simulate?

Load testing answers one question: does your app hold up when real people show up at once? The hard part is deciding how many users to simulate. Pick a number too low and the test tells you nothing. Pick one too high and you spend the afternoon chasing a failure your users will never cause. This guide explains what load testing measures, how to turn your real traffic into a realistic user count, and how to read the results without fooling yourself.

What Load Testing Actually Measures

A load test sends controlled traffic at your app and watches four things: response time, error rate, throughput, and resource use. Response time tells you how slow the app feels. Error rate tells you when it starts failing. Throughput tells you how much work it can do per second. Resource use tells you which part gives out first, usually the CPU, the memory, or the database.

When a test points at one slow endpoint, treat it like any other performance problem. Trace the endpoint, check the queries behind it, and look at what changed in the last deploy. The same step-by-step approach you use to debug a slow API endpoint in production works here, except now you can reproduce the slowness on demand instead of waiting for a user to report it.

Load Testing vs Stress Testing vs Spike Testing

These three get mixed up, but they answer different questions. Load testing checks expected traffic. Stress testing pushes past the expected peak until something fails. Spike testing throws a sudden jump in traffic at the app to see how it reacts. Most teams should start with load testing, since it matches the traffic you actually get.

Test type Traffic pattern Question it answers
Load testing Steady traffic at the expected peak Does the app handle normal busy periods?
Stress testing Traffic pushed past the peak until failure Where does it break, and how does it break?
Spike testing Sudden jump, then a fast drop Does a traffic surge cause errors or a long recovery?

Most teams should start with load testing. It matches the traffic you actually get. Stress and spike tests answer questions about the edges, so run them after you know the app survives a normal busy hour.

How Many Users to Simulate: Start With Real Traffic

Do not guess the number. Start with your analytics. Look at the busiest hour of the last 30 days and note the peak concurrent users, or the peak requests per minute if your analytics only tracks requests. That peak is your baseline. Your load test should cover it, then go a bit beyond it.

If the app is new and has no traffic history, work from business numbers instead. Take the daily active users you expect, then estimate how many of them are online at once during the busiest hour. As an example, if you expect 10,000 visitors a day and roughly 15 percent arrive during the busiest hour, that is about 1,500 people in that hour. Not all of them are active at the same second, so your concurrent user count will be lower. The formula in the next section turns that hourly number into a concurrent count.

Then decide how much headroom to test. A common approach is to test at 1.5 times your current peak. If a launch, sale, or marketing campaign is coming, test at 2 times the peak. Pick a multiplier you can defend, not one that impresses anyone. A test at 10 times your real peak mostly tests a scenario that will never happen.

A Simple Formula for Concurrent Users

The standard way to convert traffic into a user count is Little’s Law: concurrent users equals the arrival rate multiplied by the average session length. In plain terms, if 20 new sessions start every second and the average session lasts 180 seconds, you have about 3,600 concurrent users at any moment (20 times 180).

To use it, you need two numbers from your analytics. First, the arrival rate: how many new sessions start per second during your busiest hour. Second, the average session length. Multiply them and you get the concurrent users to simulate. If your analytics reports requests per minute instead of sessions, divide by the average requests per session first, then apply the same formula.

This is where most bad load tests go wrong. The formula only works if your virtual users behave like real ones, and real users pause. They read a page, think, then click. That pause is called think time, and a test with zero think time hammers the server far harder than the same number of real users ever would. A common starting point is 5 to 10 seconds of think time between actions, adjusted to match what your analytics shows for time between page views.

Ramp-Up, Think Time, and Session Length

Three settings change the result more than the user count itself. Get them wrong and the number you picked stops meaning anything.

Ramp-up. Add users gradually instead of all at once. Ramping from zero to your target over 10 minutes gives the app, the database connection pool, and any caches time to warm up. Dumping 5,000 users on the app in the first second tests a spike, not a normal busy period. Hold the peak steady for at least 10 to 15 minutes so you can see whether performance stays stable or slowly gets worse.

Think time. As above, real users pause between actions. Set think time per step in your scenario, not one global value. A checkout flow has longer pauses than a search results page. If your load test tool supports it, randomize think time within a range so the traffic pattern looks less mechanical. While the test runs, watch the same dashboard you use in production. If you already collect logs, metrics, and traces for your app, use it here. Response time climbing while CPU stays low usually points at the database or a downstream service, not at a lack of servers.

Session length. Model real journeys, not just homepage hits. Good load test scenarios mix browsing, searching, logging in, and checking out in the same proportions your analytics shows. An app that survives 5,000 users on the homepage can still fall over when 500 of them run a heavy search at the same time, so include the expensive actions.

Mistakes That Make Load Tests Useless

Most load tests fail before they start, and the cause is usually one of these:

  • Testing a staging server that does not match production. A smaller database, fewer CPU cores, or a different configuration makes the result meaningless. If staging cannot match production, say so in the test report and treat the numbers as relative, not absolute. The effort of keeping a staging environment that matches production pays off exactly here.
  • Testing from one machine. The load generator can run out of CPU or bandwidth before your app does. If it hits 100 percent CPU, your results measure the generator, not the app. Spread the load across several machines for large tests.
  • Testing only the homepage. The homepage is usually cached and cheap. The search page, the checkout, and the report export are where the cost lives. Include them.
  • Ignoring the database. The app server is rarely the first thing to break. Watch slow queries, connection pool usage, and lock waits during the test. A load test that never looks at the database misses the most common bottleneck.
  • Running against production without telling anyone. A load test looks exactly like an attack to your monitoring and to your team. Coordinate the timing, warn support, and have a way to stop the test fast if real users start seeing errors.

Frequently Asked Questions

How often should I run load tests? Before big releases, after infrastructure changes, and before any event you expect to bring a traffic surge. A test run once a year tells you little. A short test on a regular schedule catches slow regressions while they are still small.

Can I load test production? Yes, with care. Test during a low-traffic window, start small, and stop immediately if error rates rise. A careful production test is the only way to measure the real setup, including the load balancer in front of your servers.

What is a good response time under load? There is no universal number. Compare the results against your own baseline at low traffic. If the 95th percentile response time doubles at peak load, that is a problem worth fixing even if the absolute number still looks fine.

Start with your real peak traffic, convert it to concurrent users with Little’s Law, and test at 1.5 times that number with realistic think time and real user journeys. Fix the slowest thing the test finds, then run it again.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.