serverless: Provisioned Concurrency Does Not Work As Described
Bug Report
Provisioned Concurrency was recently added in Serverless v1.59 and described in detail in this blog post: https://serverless.com/blog/aws-lambda-provisioned-concurrency/
The blog post makes the claim that enabling provisioned concurrency is as easy as:
functions:
hello:
handler: handler.hello
events:
- http:
path: /hello
method: get
provisionedConcurrency: 5
This is not true.
What this configuration will do is assign provisioned concurrency to the version number that was deployed, but API Gateway will continue invoking the Lambda with the $LATEST alias (no version). What effectively ends up happening is every deploy keeps assigning provisioned concurrency to each new version and never actually utilizes it. If a developer does not use any version pruning they will quickly rack up an expensive bill paying for new provisioned capacity on each version, and potentially worse, eventually exhaust their reserved (or unreserved) concurrency on their AWS account.
I think this is a critical issue and needs to, at the very least, be addressed in the blog post. Without some form of version cleanup or aliasing I don’t think there’s much Serverless can do to make this work in a simple configuration like that.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 33
- Comments: 38 (16 by maintainers)
Commits related to this issue
- fix: Do not set optional ParallelizationFactor when not explicitly set Fixes #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix: Fix provisioned concurrency support So it doesn't leave outdated versions with configured concurrency Fixes #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix: Fix provisioned concurrency support So it doesn't leave outdated versions with configured concurrency Fixes #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix: Fix provisioned concurrency support So it doesn't leave outdated versions with configured concurrency Fixes #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix: Prevent "Internal error" by configuring prov concurrency via alias Addresses #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix: Prevent "Internal error" by configuring prov concurrency via alias Addresses #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix: Prevent "Internal error" by configuring prov concurrency via alias Addresses #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix(AWS Lambda): Fix provisioned concurrency configuration Addresses #7059 - So it works with multiple lambda versions - “internal error” is avoided on change of provisioned config configuration — committed to serverless/serverless by medikoo 5 years ago
- fix(AWS Lambda): Fix provisioned concurrency configuration Addresses #7059 - So it works with multiple lambda versions - “internal error” is avoided on change of provisioned config configuration — committed to serverless/serverless by medikoo 5 years ago
- fix(AWS Lambda): Fix provisioned concurrency configuration - So it works with multiple lambda versions - “internal error” is avoided on change of provisioned config configuration Addresses #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix(AWS Lambda): Workaround AWS issue related to alias redeployments Addresses #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix(AWS APIGW): Ensure to point provisioned version Addresses #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix(AWS Lambda): Fix provisioned concurrency configuration - So it works with multiple lambda versions - “internal error” is avoided on change of provisioned config configuration Addresses #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix(AWS Lambda): Workaround AWS issue related to alias redeployments Addresses #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix(AWS APIGW): Ensure to point provisioned version Addresses #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix(AWS Lambda): Fix provisioned concurrency configuration - So it works with multiple lambda versions - “internal error” is avoided on change of provisioned config configuration Addresses #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix(AWS Lambda): Workaround AWS issue related to alias redeployments Addresses #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix(AWS APIGW): Ensure to point provisioned version Addresses #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix(AWS Lambda): Fix provisioned concurrency configuration - So it works with multiple lambda versions - “internal error” is avoided on change of provisioned config configuration Addresses #7059 — committed to serverless/serverless by medikoo 5 years ago
- fix(AWS Lambda): Workaround AWS issue related to alias redeployments Addresses #7059 — committed to serverless/serverless by medikoo 5 years ago
I’ll reopen until we have all issues mentioned here solved.
@vavarodrigues it’s still not really fixed, but it should be shortly with v1.60.2, stay tuned.
@AndrewBarba great thanks for reporting that issue
We will shortly (hopefully tomorrow) publish an update that fix the behavior in a framework (to make blog post accurate).
@medikoo My obervations are following (severless version: 1.59.3)
These issues making it really hard to use the provisioned concurrency in serverless
This is the issue on AWS side (note
Internal Failurecomes from CloudFormation stack update, you can also see it in AWS console). We’ve communicated that issue to AWS, still we have no response on that so far.I’m clarifying with AWS, the best way to handle that, if going through CloudFormation will be communicated as not stable (for prolonged period), we’ll probably reconfigure our support to go through custom resources.
We had many fixes related to provisioned concurrency support, since that version. Always ensure to use latest version of a Framework
provisionedalias is configured by Framework automatically, note that provisioned concurrency can only be set on alias (and it won’t work for$LATEST)Therefore to inspect provisioned concurrency in AWS console, you need to visit a
provisionedalias for your lambda@RogerVFbr i went back to using https://github.com/AntonBazhal/serverless-plugin-lambda-warmup until the provisioned currency issues have been resolved
Problem seems to persist. Any ideas if a fix is underway? This is very important for our project. Provisioned concurrency still seems to be pointing to a function version instead of $LATEST. “versionFunctions” has been set to “false” and alternative versions have been cleaned via script. However running “sls deploy” with some “provisionedConcurrency” value attached to the function declaration creates an alternative function version and points the provisioned concurrency to it. Redeploying the project does not seem to affect the situation. Is it possible that the version stated is equivalent to $LATEST, therefore it would be working? Can anybody please show a way to test if the invocation of latest is making use of the provisioned concurrency with this configuration?
Definitely some issues. Subsequent deploys leave the provisioned concurrency configuration attached to the special version that is not $LATEST as @medikoo says above.
Also to get this to work with an existing lambda, I had to delete all the versions then set versionFunctions to false. You can use this handy script if you’re having issues with that: https://gist.github.com/tobywf/6eb494f4b46cef367540074512161334