Performance Testing and Load Testing: Finding Breaking Points Before Users Do

Design and execute performance tests that reveal your system's limits before production traffic does. Covers load testing strategies, tool selection, realistic traffic patterns, baseline establishment, bottleneck identification, and the reporting process that turns performance data into engineering decisions.

Establish Your Test Target and Baseline

Performance testing and load testing exist to answer one question: what happens when your system is asked to do more than it was designed for? This page covers the practical workflow of generating traffic, measuring responses, and identifying the exact point where a service stops accepting requests, begins dropping them, or starts returning incorrect data. It matters whenever you ship a new endpoint, scale a cluster, change a database schema, or deploy a feature that could receive more traffic than your staging environment saw. The following sections are organized by the specific task you’re trying to complete, with concrete commands, flags, and error text you can copy today.

Generate Controlled Traffic with wrk

wrk is a lightweight, embeddable HTTP benchmarker that runs on Linux, macOS, and WSL. It requires no runtime framework and is available via most package managers (apt-get install wrk, brew install wrk, or download the binary from the official release page).

Exact command and flag breakdown:

wrk -t12 -c400 -d30s -s ./lua/rate_limit.lua http://localhost:8080/api/search

If you don’t need scripting, drop -s and provide the target URL(s) directly:

wrk -t12 -c400 -d30s http://localhost:8080/api/search

Identify the Breaking Point

When wrk finishes, it prints a summary to stdout containing three fields: latency distribution, socket error rate, and requests per second. The exact format varies by version, but the fields always include a latency percentile breakdown, a Socket errors count, and a Requests/sec rate.

You can identify a breaking point by watching for these conditions in the output:

To catch server‑side errors that wrk may still count as successful responses, run a parallel health‑check loop and watch for HTTP status codes:

while true; do curl -o /dev/null -s -w "%{http_code} %{time_total}\n" http://localhost:8080/api/search; done &

Look for 503, 504, or 429 codes appearing alongside increasing latency. A sudden influx of 503 responses typically means the server’s admission control (rate limiting, circuit breaker, thread‑pool exhaustion) is actively rejecting traffic.

Ramp Connections Systematically to Locate the Limit

To pinpoint the exact breaking point, increment -c in steps and re‑run the command until one of the signals above changes character.

  1. Start at -c100, run 30 s. Record the Requests/sec, latency percentiles, and Socket errors.
  2. Increase to -c200, repeat.
  3. Continue increasing (-c400, -c800, etc.) until either Socket errors > 0 or latency percentiles exceed your acceptable ceiling.

The -c value just before the shift is your current breaking point under that traffic pattern.

If you need finer granularity, decrease the step size (-c120, -c140, etc.) around the transition point. Document the exact -c, the observed latency, and the error type in your wiki so the next engineer can compare against future changes.

Sharp Edges — What Silently Fails, Confused Options, Production Gotchas

Iterate and Document Your Findings

Once you’ve identified the breaking point, record the exact -c value, the observed latency percentiles, and the error type. This becomes a baseline for future regressions. If you change a thread pool size, database connection pool, reverse‑proxy buffer, or any middleware config, re‑run the same wrk command and compare the summary line. Document the result alongside the change that caused it, so the next engineer doesn’t have to rediscover the limit.

This page was rewritten on 18 October 2026. It replaced a templated version that was not specific to its own title. How these pages are written and checked. If anything here is wrong, tell us at [email protected] and we will correct it.