Resource Exhaustion
Resource exhaustion occurs when available capacity is consumed so that work cannot proceed as required. In AI systems this can involve memory, workers, request quotas, or spending limits. It may result from attack, accidental loops, or legitimate overload.
A small request can trigger much work
A fictional assistant repeatedly retrieves documents and calls tools while trying to finish one task. The initial message can be short while downstream work keeps growing. Limiting message length alone will not bound the whole operation.
Bound work and verify cancellation
Set relevant limits on concurrency, duration, iterations, and resource use at the executing services. OWASP’s API Security Top 10 names the same class of defect โ unrestricted resource consumption โ and its list of the limits an API should enforce is a usable checklist: execution timeouts, maximum allocable memory, maximum number of processes and file descriptors, maximum upload size, a cap on operations per request, a cap on records returned per page, and a spending limit for third-party services. Preserve capacity for legitimate users and define fallback behavior. A client timeout can stop waiting without stopping downstream computation. Test whether cancellation reaches that work and whether retries start additional copies. Cost monitoring detects usage; it is not automatically a hard enforcement limit. OWASP’s guidance makes the distinction concrete for the money case: configure spending limits with the provider, and where limits are not available, configure billing alerts โ which is detection, and a different thing.
Exhaustion is also the outcome that the load-management patterns exist to prevent. Throttling caps what one caller may consume, load shedding drops work cheaply so the accepted work completes, and backpressure pushes the limit upstream instead of letting queues grow without bound. Which of them applies depends on whether the scarce resource is yours to protect or someone else’s to slow down. For contention that degrades a neighbor without exhausting anything, see noisy neighbor.
References
- NIST: Information Security
- OWASP API Security Top 10 (2023): API4:2023 Unrestricted Resource Consumption
Discover more from Insightful Data Lab
Subscribe to get the latest posts sent to your email.
