Skip to content

Insufficient capacity error when triggering a Lambda function

0

I have been using Lambda for basic start/stop instances that have specific tags, the functions have been utilised almost daily with no problem.

Recently one of the functions triggers a "Insufficient capacity" error. I have tried moving the function to a different region but still receive the same error.

What does the error mean and is there a way to resolve this.

asked 2 years ago305 views

1 Answer
1
Accepted Answer

The "Insufficient capacity" error you're experiencing with your Lambda function typically indicates that AWS doesn't have enough available compute capacity to execute your function at that moment. This can happen for various reasons, even if the function has been working fine previously.

To address this issue, you can try the following approaches:

  1. Increase the function's memory: Sometimes, increasing the memory allocation can help, as it may provide access to different hardware resources. Try incrementally increasing the memory setting for your function.

  2. Check concurrency limits: Ensure that you haven't hit your account's concurrency limits. By default, AWS accounts have a limit of 1,000 concurrent executions across all functions in a region. If you're close to this limit, you may need to request a quota increase.

  3. Use reserved concurrency: Set up reserved concurrency for your critical functions. This ensures that a specific amount of concurrency is always available for those functions, preventing other functions from consuming all available concurrency.

  4. Implement retry logic: Add retry logic to your function or the system that invokes it. This can help overcome temporary capacity issues by attempting to run the function again after a short delay.

  5. Spread across multiple regions: If moving to a different region didn't help, consider distributing your workload across multiple regions to reduce the likelihood of capacity issues in any single region.

  6. Contact AWS Support: If the problem persists, it may be worth contacting AWS Support to investigate if there are any underlying issues specific to your account or the regions you're using.

Remember that while "Insufficient capacity" errors are usually temporary, implementing some of these strategies can help mitigate the impact on your operations and improve the reliability of your Lambda functions.
Sources
Troubleshoot invocation issues in Lambda - AWS Lambda
Lambda quotas - AWS Lambda
How Lambda handles errors and retries with asynchronous invocation - AWS Lambda

answered 2 years ago

EXPERT

reviewed 2 years 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.