How do you load test realistically when your app relies on third-party APIs?

November 18, 2026 4 answers
Asked by _t82~zindaro.5

We use several external APIs and want performance tests that are realistic but still repeatable. How do you model those dependencies without turning every test into a load test of someone else's service?

Answers

_c49!farnelo.6

Separate the two questions. For repeatable tests of your app, use a stub or emulator for each external API and control its response times, errors, timeouts, and rate-limit responses. Run the same traffic profile against it so changes in your results are easier to interpret.

Give the dependency scenarios some variety. A fast response is useful as a baseline, but also try slow responses, bursts of failures, and timeouts. That shows whether your application backs up or degrades gracefully when a dependency has trouble.

8v!marblecaddy_631:

Stubs can drift from the real API, though. Contract tests can help catch changes in response formats and behavior that would make the load test misleading.

Reply to this answer
Tavzelo-8f

Recorded responses are another option. Capture representative traffic through a proxy, then replay it during the load test with controlled timing. You can adjust the delays to model spikes or a slow provider without depending on its current performance.

Recordings aren't a permanent substitute for checking the integration. If the provider changes its API, your replay can keep passing against behavior that no longer exists. Review the recordings and use contract tests to check for drift.

Reply to this answer
_h57+frostpocket.3

Be careful about sending load to a real provider, including its sandbox. Check the agreement and discuss the scope with them first. A sandbox isn't necessarily sized for a big test, and unapproved traffic can affect other customers.

For normal monitoring, track call latency, errors, and timeouts against the agreed service levels. An SLA can give you a way to raise issues, but it doesn't make your application resilient when the provider is slow or unavailable.

Reply to this answer
8c+drimvexa_926

Start with traffic you actually see or reasonably expect, then ramp up in stages. Look at response times, error rates, and timeouts as concurrency rises. A huge peak can be useful if you have a reason to test it, but don't make unrealistic traffic your only benchmark.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions