What should be the maximum provisioned concurrency for lambda function triggered from API gateway?

Viewed 204

What should be the ideal provisioned concurrency set on AWS Lambda function which is serving HTTP requests using API gateway to reduce latency for API requests

1 Answers

Answering based on the comments.

Once you updated your function, existing instances of the function will still run the old version for few minutes. From AWS forum:

While we do not abort in-flight invocations, we will aggressively eliminate copies of the old code; this typically happens within a minute of a function being updated. That means that for up to about 5-6 minutes (the max duration of a function, plus a little bit) you can experience either/both versions in use; after that, you should see only the newly deployed) version executing.

The post refers to 5-6 minutes, but now function execution time is 15 minutes. Thus its not clear if this time extended as well.

To somehow control this process, you can look at canary lambda deployments. You can also perform canary deployments for API gateway.

Related