Skip to content

AWS Lambda@Edge Execution Limits(Quota) ?

0

Hello, I'm implementing an on-the-fly image resizing feature using AWS S3 + CloudFront + Lambda@Edge.

However, I'm having a problem. When I run multiple Lambda@Edge instances at once, I get a 503 LambdaLimitExceeded from cloudfront error. (I think it's due to the 10-execution limit.)

Error

Error

However, this makes it unusable for production use. So, how can I increase this limit? Checking Service Quotas, I see that the account has a 10-execution limit.

By the way, this is Lambda. Does this also apply to Lambda@Edge? If so, should I request an increase in the execution limit to resolve this issue? (I'm also curious if this is the approach for large-scale production services.)

And finally, I'm also curious about how much I should increase to be efficient. Thank you. (Sorry for my poor English.)

1 Answer
0

AWS Lambda has a default concurrency limit of 1,000 concurrent executions per region for your account. This limit applies to the total number of Lambda function executions happening simultaneously across all functions in a region.

When you're experiencing the "LambdaLimitExceeded" error from CloudFront with your Lambda@Edge implementation, this indicates you've reached a concurrency limit. Lambda@Edge functions are subject to the Lambda service quotas, but they have some specific considerations since they run at CloudFront edge locations.

To resolve this issue, you have several options:

  1. Request a concurrency limit increase: You can request an increase to your Lambda concurrent execution quota through the AWS Service Quotas console. This is a common approach for production services with high traffic volumes.

  2. Implement reserved concurrency: You can allocate a specific amount of your account's concurrency to your Lambda@Edge function to ensure it always has capacity available.

  3. Optimize your function: Ensure your image resizing function is as efficient as possible to reduce execution time, which directly impacts concurrency needs.

For determining how much to increase your limit, you should calculate your expected concurrency using this formula: Concurrency = (average requests per second) × (average function duration in seconds)

For example, if you expect 100 requests per second and your function takes 0.5 seconds to complete, you would need at least 50 units of concurrency.

For production services with significant traffic, requesting a higher concurrency limit is a standard practice. Many large-scale applications operate with increased Lambda concurrency quotas to handle their workloads efficiently.
Sources
Lambda quotas - AWS Lambda
Understanding Lambda function scaling - AWS Lambda
AccountLimit - AWS Lambda
Quotas - Innovation Sandbox on AWS

answered a year ago

EXPERT

reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.