Load testing basics: design workloads and read the results

Model application load, distinguish virtual users from arrival rates and requests, set meaningful thresholds, and investigate results with traces, logs, and generator metrics.

Best practices
Illustration of testing, measurement, and quality verification

A latency chart can look healthy because the test stopped delivering the intended traffic. Before treating a run as a success, check what actually reached the application, how many requests completed, and which work never started.

Load testing evaluates an application under a defined workload, duration, and environment. It can reveal bottlenecks and provide evidence about capacity and performance targets within those conditions. It cannot establish that the application will stay fast or avoid failure in every production scenario.

This guide is based on official documentation. No application load test or performance benchmark was run for it. Thresholds below are examples; workload data, environment, and configuration need to match your project.

Look at the backend and the browser

Perspective What to measure Typical approach
Backend Throughput, response duration, and errors under load Protocol-level API traffic from k6, Locust, or JMeter
Frontend Page loading and interaction in a browser Browser automation or synthetic tests alongside backend load; real user monitoring adds production context but does not generate test load

A fast API does not establish that a page is fast. Rendering, resource downloads, and third-party scripts still matter. Conversely, a slow page is not automatically a backend problem. Protocol requests do not execute a page's JavaScript or measure rendering; browser-based testing has its own resource cost.

Write a script that represents the work

  1. Start with the journey. Login, browse, and checkout form a useful end-to-end flow. An isolated endpoint test remains useful for capacity work or a focused regression. Choose the scope that answers the question; one does not replace the other.
  2. Vary the data deliberately. Match the intended account, query, and dataset distribution. Reusing one account and search term can create cache hits or contention that the intended workload would not have.
  3. Pace the right unit. A session model may need think time. An arrival-rate executor controls iteration starts; do not add an unconditional sleep at the end to control a rate already scheduled by the executor.
  4. Check the response body. HTTP 200 can still contain an error page. Validate important fields, then configure how a failed check affects the run. In k6, a check records its success rate; a threshold is needed to turn that condition into a failed test.

Match the traffic model to the question

  • Load shape: a gradual ramp, hold, and ramp-down works for many ordinary load tests. A spike test intentionally changes traffic sharply, so avoiding every sudden increase would defeat its purpose.
  • Concurrency and arrivals: a virtual user (VU) is a concurrent script-execution unit, not a count of distinct people. Iterations started per second are different from requests per second; one iteration may send several requests. With a closed model, slower iterations can reduce the arrival rate at a fixed VU count. An open arrival-rate model schedules iteration starts independently of their completion, but still needs available VUs and generator resources. The configured rate is not the achieved completion rate.
  • Test type: an ordinary load test examines expected normal or peak traffic. A stress test examines degradation and recovery above expected load; crashing the system is not a required goal. Spike tests examine abrupt changes. Soak tests examine sustained behavior and resource growth. Increasing memory is a lead to investigate, not proof of a leak.

Keep the test reusable

Treat scripts as maintained software. Extract login, authentication, and data preparation into modules; configure environments, credentials, and thresholds separately; and keep output formats consistent across runs.

Save the application and script versions, tool settings, data distribution, and resource sizes with the results. A changed environment or configuration makes a direct before-and-after comparison ambiguous. Reusable application load testing is useful before a major release because the workload and its assumptions can be repeated and examined.

Choose the environment deliberately

Environment Benefit Risk
Production-like staging Easier isolation and lower risk, while still protecting shared dependencies Cost and data sanitization; caches, dataset size, and dependencies may still differ
Production during a quiet period Real infrastructure and dependencies, although the test traffic still needs modeling Impact on real users; needs traffic limits and a stop plan. Quiet-period results do not establish peak behavior

Obtain explicit permission for the target and downstream services. Use sandbox or mock payment and messaging systems; notifying an owner is not a substitute for authorization. Set test tenants, cleanup rules, traffic and cost limits, and immediate stop conditions. Check whether staging still reaches a shared production dependency.

Define the metrics before the threshold

  • Response duration: inspect p90, p95, and p99 rather than relying on the mean. State the endpoint, time window, sample count, and whether the population includes all requests or only successful ones. p95 is not the maximum, and averaging separate machines' or windows' p95 values does not produce a global p95. k6's http_req_duration excludes initial DNS lookup and connection establishment, so it is not a complete user-action duration.
  • Throughput: define the business transaction behind TPS, and distinguish scheduled arrivals, requests sent, and successful completions. Read RPS/TPS alongside latency, errors, and the generator's CPU, memory, and network use. A bend in one curve does not identify the limiting component.
  • Errors and missing work: define success using the response and business SLO. Keep HTTP outcomes and business checks separate, including expected overload rejections. Record iterations that never started or were interrupted. In an arrival-rate scenario, k6's dropped_iterations can indicate that no VU was available; those are not requests the server received and rejected.
  • Resource saturation: inspect the specific CPU, memory, connection pool, or disk I/O involved. If the load generator reaches its limit first, the run may be measuring traffic-generation capacity rather than application capacity.

Write criteria such as p95 < 800 ms and error rate < 0.1% before running, with the metric population, target load, and duration attached. These are example values. If the intended traffic was not delivered, or substantial work was dropped or interrupted, good latency among completed requests is not enough to declare success.

Investigate what changed

Plot response duration over time. Look for gradual degradation or a sudden change as load increases, then align slow-request distributions with component metrics. That narrows the investigation; simultaneous changes alone do not establish causation. Check call paths, queue waits, and controlled repeat runs.

A useful conclusion states what the current configuration achieved under the tested workload and duration, and which change to test next. Measure again after scaling. Capacity does not necessarily grow linearly with node count.

For a service already instrumented in Guance, inspect the collected slow trace's Span durations, then use trace_id to find related logs. Follow the trace–log correlation setup to keep trace_id, span_id, service, environment, and version fields consistent. Check log-index mapping, the time range, and data-access permissions.

Both traces and logs must have been collected and still be retained. A trace removed by sampling cannot be recovered just because a log contains its ID. Record the test batch and time window, isolate that traffic, and inspect request details; nearby timestamps alone do not identify the same request.

Common questions

How often should we run a load test?

Include runs before major releases and anticipated traffic events. Critical journeys can also have a recurring regression run, for example monthly. Keep the workload comparable so the trend means something.

Why does the test disagree with production?

Check the workload model, data distribution, cache state, software version, resource sizes, and dependencies, then confirm that the generator delivered the planned traffic. Missing think time can distort a session model; adding sleep mechanically is not the answer for an arrival-rate model. Use controlled comparisons to isolate differences rather than assigning a cause from a single summary curve.

What if a small team has no performance engineer?

Start with a code-oriented tool such as k6 or Locust. Give a core endpoint a low-load baseline in an isolated environment and compare it across releases. Arrange authorization separately for tests that push limits. A repeatable, bounded baseline is more useful than waiting for a perfect testing framework.

Official references

Documentation checked: November 5, 2026.

Further reading

Get a tailored plan

Contact us

Join the community

Scan with WeChat
to join the community

Try Guance

Start online and pay only for what you use.

Get started

Choose a Guance plan

Code hosting