AWS Builder Center

A Practical Capacity Model for AWS Lambda: Beyond Concurrency

Lambda capacity is not only a concurrency problem. This article proposes a compact decision framework that combines execution duration, request throughput, security filtering, downstream limits, and budget to determine the smallest safe capacity for a Lambda workload.

Devops & Cloud Engineer
AWS Lambda workloads can sometimes return throttling errors even when the basic concurrency calculation looks correct. For example, a function receiving 20,000 requests per second with an average execution time of 50 ms appears to need only 1,000 concurrent executions, because 20,000 × 0.05 = 1,000. However, Lambda capacity is not defined by concurrency alone. Synchronous invocation throughput can also become the limiting factor, so the function may still return 429 TooManyRequests even when the expected concurrency ceiling has not been reached.
To represent this more accurately, we can use the following capacity model:

where R-eff is the effective request rate reaching Lambda and D-p99 is the p99 execution duration in seconds. If security filtering is also considered, effective traffic can be modeled as:

where n represents the proportion of abusive or unwanted traffic filtered before it reaches Lambda.
For 20,000 effective requests per second at 50 ms, the duration-based requirement is 1,000, while the throughput-based requirement is 2,000. Therefore, the real requirement is:

The practical solution is not simply to increase Lambda concurrency. The entire architecture should be checked for its smallest capacity limit. A useful extension of the model is:

The system should ideally operate under:

If this condition is violated, the smallest term tells you where to troubleshoot first: Lambda capacity, a database or external dependency, cost limits, or excessive unwanted traffic. The goal is therefore not maximum scaling, but the smallest safe capacity that can serve legitimate demand without creating a new performance, cost, or security bottleneck.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article