HomeGuides › API load testing

API load testing: load, stress, spike and endurance

By the Flasqo team · Updated 24 August 2026

In short

Four test shapes answer four different questions. Report p95 and p99 rather than averages, derive concurrency from real traffic, and read the result as a knee point rather than a pass mark.

  • Four different test shapes answer four different questions: load (does it meet target?), stress (where does it break?), spike (does it survive a sudden surge?) and endurance (does it leak?).
  • Report p95 and p99 latency, never the average — an average of 250ms can hide one user in twenty waiting four seconds.
  • The useful output of a load test is not pass/fail but the knee point: the concurrency where latency starts rising faster than throughput.
  • Derive concurrency from real traffic logs, then test at 1×, 2× and 5× peak.

What is API load testing?

Load testing measures how an API behaves under concurrent traffic — how latency, throughput and error rate move as the number of simultaneous users rises. It answers a question functional testing cannot: the endpoint works, but does it still work when two thousand people call it at once?

The failure mode it catches is specific and common. A service that responds in 40 milliseconds for a single caller can take four seconds at a hundred concurrent callers, because a connection pool, a thread pool, a database lock or a downstream rate limit saturates. Nothing in the code changed; only the arrival rate did.

The four test shapes

TestTraffic profileWhat it findsTypical duration
LoadSteady, at expected peakWhether you meet your latency and error targets10–30 minutes
StressRamping until failureThe breaking point and how it fails20–60 minutes
SpikeInstant jump, then dropElasticity, cold starts, autoscaling lag5–15 minutes
EnduranceModerate, sustained for hoursMemory leaks, pool exhaustion, log-disk growth2–24 hours

Load testing

Hold traffic steady at the level you expect at peak and confirm the system meets its targets. This is the baseline test: it should pass. If it doesn't, nothing further is worth measuring until it does.

Stress testing

Ramp concurrency past the expected peak until something gives. The point is not to survive but to learn how it fails. A system that sheds load cleanly with 503s and a Retry-After header is in far better shape than one that accepts every request and times out on all of them.

Spike testing

Jump from near-idle to very high traffic in seconds. This is what a marketing email, a product launch or a link on a popular aggregator actually looks like. Spike tests expose cold-start latency in serverless functions and the lag between an autoscaler noticing load and capacity arriving — often 60 to 300 seconds, during which the existing instances absorb everything.

Endurance testing

Hold a moderate, comfortable load for hours. Defects here are slow: a heap that grows a few megabytes per thousand requests, database connections that are never returned to the pool, log files filling a disk. None of these appear in a 15-minute run, and all of them cause 3am incidents.

Why p95 and p99 beat the average

Consider a hundred requests: ninety-five return in 50ms, five take 4 seconds. The mean is roughly 250ms, which looks healthy on a dashboard. But one user in twenty waited four seconds, and those are the users who complain, abandon carts and retry — adding yet more load.

Percentiles describe experiences; averages describe arithmetic. The p99 is the number that corresponds to your worst customer experience, and it is where queueing, garbage collection pauses and lock contention show up first.

Track the full distribution: p50 for the typical case, p95 for the edge of normal, p99 for the tail. A p50 that stays flat while the p99 quadruples is the signature of a resource beginning to saturate — the earliest warning you will get.

Choosing concurrency

Round numbers like "test with 1000 users" are arbitrary. Derive the figure instead:

  1. Take peak requests per second from your access logs — the busiest minute of the busiest day in the last month.
  2. Test at 1× that rate to establish the baseline and confirm you meet targets today.
  3. Test at 2× to cover ordinary growth and campaign traffic.
  4. Test at 5× to find the knee point and know the headroom you actually have.

Include realistic think time between requests. A test that hammers an endpoint with zero delay produces a traffic pattern no real client generates, and usually measures your load generator rather than your API.

Reading the results

Three curves matter, and their relationship tells the story:

Beyond the knee, added concurrency buys nothing but latency: requests queue rather than execute. Capacity planning targets a comfortable margin below that point, not the maximum the system can technically survive.

Common load testing mistakes

Load test your API without writing a script

Paste a URL. Flasqo discovers your endpoints, generates the suite and runs it — free, no credit card.

Start testing free

Frequently asked questions

What is the difference between load, stress, spike and endurance testing?

Load testing holds expected traffic steady to confirm the system meets its targets. Stress testing pushes past that point to find where it breaks. Spike testing jumps from low to very high traffic instantly to test elasticity. Endurance testing holds moderate load for hours to expose memory leaks and connection-pool exhaustion.

Why use p95 and p99 latency instead of the average?

Averages hide the failures users actually notice. If 95 requests return in 50ms and 5 take 4 seconds, the average is a healthy-looking 250ms while one user in twenty waits four seconds. The p99 is the number that corresponds to your worst customer experience, and it is where queueing and garbage collection show up first.

How many concurrent users should I test with?

Start from real traffic rather than a round number: take peak requests per second from your logs, then test at 1x, 2x and 5x that figure. The useful output is not a pass mark but the knee point — the concurrency where latency starts rising faster than throughput.

What is the knee point in a load test?

The knee point is where added concurrency stops increasing throughput and starts only increasing latency, because a resource has saturated. Below it the system scales; above it queues grow without bound and errors follow. Capacity planning targets a comfortable margin below the knee.

Related reading

API Testing: The Complete Guide GraphQL API Testing: Queries, N+1 & Depth Limits API Smoke Testing: Fast Health Checks for Critical Endpoints API Regression Testing: Prevent Breaking Changes in Production API Fuzz Testing: Break It Before Attackers Do API Integration Testing: Validate Multi-Endpoint Workflows API Auto-Discovery: Endpoint Detection & Scoring Flasqo vs JMeter Flasqo vs k6 Flasqo vs Apidog 11 Best Free API Testing Tools in 2026