-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set Concurrency Limit to 1 in CloudFormation Stack #206
Comments
Wouldn't that incur costs when the lambda isn't actually executing? Is the problem an issue of locking (where one lambda execution is still running while another execution tries to start)? That could be solved by a locking structure in dynamo DB or potentially with step functions. |
This would be best practice approach https://aws.amazon.com/about-aws/whats-new/2017/11/set-concurrency-limits-on-individual-aws-lambda-functions/ <https://aws.amazon.com/about-aws/whats-new/2017/11/set-concurrency-limits-on-individual-aws-lambda-functions/>
I t would be modest effort to implement, however it is unlikely to be necessary, in all be very specific combination of circumstances.
Chris
|
We have the lambda function running every x minutes. Every so often an execution will exceed the x number of minutes and there will be > 1 running simultaneously. Alternatively, we were considering having executions be triggered by changes in Google Workspace (as opposed to being timer based), but that runs the risk of triggering multiple if one is already in progress. Not being able to configure or limit It felt like a footgun. |
per https://docs.aws.amazon.com/lambda/latest/dg/provisioned-concurrency.html
|
The naming of these properties can be some what confusing. |
Issue #, if available: #206 Description of changes: Updated the CloudFormation template to hardcode the maximum allowed concurrency for the lambda function to 1. There is no situation under which it would be safe to run more than one instance. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
I will note, for posterity, that if you create a new account to be the Delegated Administrator for your IAM Identity Center instance, and you install this stack in that new account (or any other freshly created account), then even though the "default" quota for "Concurrent executions" is 1,000, the new account will have a "Concurrent executions" quota of 10. In theory this is supposed to automatically increase up to the "real" default of 1000 over time as you use Lambda, but another quirk of the "Concurrent executions" quota is that you can never have fewer than 10 "unreserved" executions, so, with the "Concurrent executions" limit at 10, deploying this app will fail with the error "Specified ConcurrentExecutions for function decreases account's UnreservedConcurrentExecution below its minimum value of 10". |
@philomory running into exactly the same issue. Any workaround? |
Either request a quota increase, wait for it to be granted, and then deploy; or edit the YAML manifest file and set the concurrency to 0; or both (as in, request a quota increase, deploy with a manually edited YAML while waiting for it to be approved, and then edit the YAML back and deploy again) |
Thanks! Deploying serverless app from template for the first time, didn't know the yaml could be edited |
Is your feature request related to a problem? Please describe.
It's possible to have several instances of the lambda function simultaneously. This could lead to race conditions. I can't imagine any scenario where someone would want multiple executions of the lambda function simultaneously.
Describe the solution you'd like
Set
ReserveConcurrency Limit to 1 for the Lambda function within the CloudFormation Stack/AWS Serverless App Repo.The text was updated successfully, but these errors were encountered: