How do I request a concurrency limit increase for my Lambda function?

4 minute read
0

I need to increase my AWS Lambda function's concurrency limit so the function doesn't get throttled.

Short description

To increase your Lambda function's concurrency limit, you must open a quota increase case in the Service Quotas dashboard.

For more information, see Lambda function scaling and managing concurrency for a Lambda function.

Important: When you increase your concurrency limit, you increase the cost of your AWS account. For more information, see AWS Lambda pricing. Your concurrency limit is shared across all the functions in your account that are in a specific AWS Region.

Resolution

Verify the reason to confirm that a concurrency limit increase is required for your use case

Follow the instructions in How do I troubleshoot Lambda function throttling with "Rate exceeded" and 429 "TooManyRequestsException" errors?

Also, make sure that you review your Concurrent executions metric in the Service Quotas dashboard to see your current concurrency usage.

Calculate your required concurrency limit

Important: Make sure that you request a concurrency limit appropriate for your use case. AWS denies requests for high concurrency limits that don't have a valid use case.

Multiply your function's average runtime duration in seconds by the average number of requests (invocations) the function receives per second. The result is your required concurrency limit.

Important: If you use unreserved concurrency, make sure that the limit isn't higher than the AWS Region concurrency limit.

When you calculate your required concurrency limit, note the following:

  • The default concurrency limit per AWS Region is 1,000 invocations at any given time. However, new AWS accounts have reduced concurrency and memory quotas.
  • There is no maximum concurrency limit for Lambda functions. However, limit increases are granted only if the increase is required for your use case.
  • To avoid throttling, it's a best practice to request a limit increase at least two weeks before the increase is needed.
  • If you're using Lambda with CloudFront Lambda@Edge in Amazon CloudFront, then you must open a separate quota increase case for each Region.

Example concurrency limit calculation

60 second average function runtime duration x 20 requests on average per second = 1,200 required concurrency limit

Write a description of your Lambda function's use case

Make sure that your request for a concurrency limit increase includes the following details:

  • Concurrency limit requested
  • Anticipated average number of requests that your function will receive per second
  • Anticipated highest number of requests that your function will receive per second
  • Anticipated runtime duration
  • Function memory size
  • Invocation type (event or request-response)
  • Event source
  • Load test results that explain the reason why the quota increase is needed
  • Any additional information to help support your use case

Open a quota increase case in the Service Quotas dashboard

  1. Open the Service Quotas dashboard.
  2. Choose the AWS Lambda card. The Lambda Service quotas page opens.
  3. Choose Concurrent executions.
  4. In the Recent quota increase requests pane, choose the Request quota increase button.
  5. Enter your requested concurrency limit. Then, choose Request.
  • You can also choose the Quota Details button to display the following details:
    Previous quota requests
    Utilization percentage of your current quota
    Alarms and tags associated with your concurrency metrics

Add your Lambda function's use case description to your request

  1. Open the Service Quotas dashboard.
  2. In the navigation pane, choose Quota request history. A list of your quota requests appears.
  3. Find your concurrency limit increase request. Then, choose the Status option next to the quota increase request. The status of your request and the associated support case link appears.
    Note: The initial status of a request is Pending. After the status changes to Quota requested, the AWS Support case number appears.
  4. Choose the case number to open the ticket for your request.
  5. In the ticket's comment thread, add the description of your Lambda function's use case.
    Note: You'll receive a status update email from AWS Support that either approves or denies the request. For more information, see Requesting a quota increase.

Related information

Operating Lambda: Application design—scaling and concurrency: part 2

AWS OFFICIAL
AWS OFFICIALUpdated 2 months ago