Story #36 Request Limits · Resource Exhaustion · Streaming Reliability

The Export Request That Exhausted Every API Worker

"One large customer asked for data. Everyone else's API stopped responding"

An analytics provider buffered entire exports in memory before sending. When a large customer initiated several parallel historical exports, worker processes began restarting and unrelated APIs—dashboard queries, payment reconciliation—became unavailable.

What happened

An analytics provider offered an API for exporting historical transaction data. The endpoint accepted a date range and returned a downloadable JSON document. As customers grew, some began requesting several years of transaction history in a single call. The service buffered the entire export in memory before sending the response.

One large customer initiated several exports in parallel. Memory usage climbed rapidly, worker processes began restarting, and unrelated API requests started timing out. The endpoint had a gateway request timeout but no meaningful export-size limit, concurrency limit, or streaming strategy. The gateway’s timeout did not stop backend work immediately, so abandoned requests continued consuming resources.

The incident spread beyond the customer who initiated the exports. Dashboard queries and payment reconciliation APIs, which shared the same worker pool, became unavailable. The team initially increased instance sizes, but the problem returned as data volumes grew.

Root cause

Unbounded request work and full-response buffering exhausted shared resources. Tests used small datasets and did not simulate concurrent large requests or clients that disconnect.

The fix

The remediation introduced bounded export windows, asynchronous export jobs, per-tenant concurrency controls, and streamed responses with cancellation cleanup. Tests now exercise boundary sizes, concurrent large requests, slow consumers, cancellation, and dependency health while large exports are running.

Testing gaps and preventive tests

Payload and result-size boundaries, concurrency quotas, memory and worker saturation checks, backpressure tests, and cancellation tests. Load tests must simulate the patterns real customers use—not just single small requests.

Business impact

A resource-intensive feature degraded unrelated customer-facing APIs and caused a partial service outage.

Lesson learned

A technically valid request can still be operationally unsafe. Resource limits and isolation are part of API correctness.

The Export Request That Exhausted Every API Worker