-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
aws_lambda_nodejs: Unexisting AWS_NODEJS_CONNECTION_REUSE_ENABLED
env variable set to 1
as default
#29497
Comments
The new default for
|
Yes I agree with your proposed solution. Making this a p1 but we welcome PRs as well. |
This will actually become a moot point in just a few weeks or so. We are removing use of v2 from the CDK. |
…lt for sdk v3 lambda runtimes (#30117) Closes #29497 Related to #29538 ### Reason for this change The `AWS_NODEJS_CONNECTION_REUSE_ENABLED` does not exist in SDK v3. Including it in the environment can add to cold start times. ### Description of changes For Lambda runtimes >= Node 18, do not set the variable by default. If set explicitly, give the user a warning. We can plan to simplify this logic & deprecate the property after we deprecate Node 16 and remove it as the default runtime for this construct. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…lt for sdk v3 lambda runtimes (aws#30117) Closes aws#29497 Related to aws#29538 ### Reason for this change The `AWS_NODEJS_CONNECTION_REUSE_ENABLED` does not exist in SDK v3. Including it in the environment can add to cold start times. ### Description of changes For Lambda runtimes >= Node 18, do not set the variable by default. If set explicitly, give the user a warning. We can plan to simplify this logic & deprecate the property after we deprecate Node 16 and remove it as the default runtime for this construct. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…lt for sdk v3 lambda runtimes (aws#30117) Closes aws#29497 Related to aws#29538 ### Reason for this change The `AWS_NODEJS_CONNECTION_REUSE_ENABLED` does not exist in SDK v3. Including it in the environment can add to cold start times. ### Description of changes For Lambda runtimes >= Node 18, do not set the variable by default. If set explicitly, give the user a warning. We can plan to simplify this logic & deprecate the property after we deprecate Node 16 and remove it as the default runtime for this construct. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the bug
The AWS SDK for JavaScript v3 is included by default in AWS Lambda Node.js 18 and Node.js 20 runtimes.
NodejsFunction
construct comes with anawsSdkConnectionReuse
optional prop, which is set totrue
by default. This default automatically sets theAWS_NODEJS_CONNECTION_REUSE_ENABLED
environment variable to1
in the Lambda function's configuration.However, it has been identified that the
AWS_NODEJS_CONNECTION_REUSE_ENABLED
environment variable does not exist in AWS SDK for JavaScript v3, rendering the variable obsolete for those utilizing the more recent Lambda runtimes. This situation not only leads to unnecessary configuration, but it also has a performance impact. The inclusion of this redundant environment variable is associated with a 20ms increase in cold start times, highlighting an opportunity for performance improvement by removing this default setting for those who do not require it.Expected Behavior
see above
Current Behavior
see above
Reproduction Steps
see above
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.132.1
Framework Version
No response
Node.js Version
20.11.1
OS
Ubuntu 22.04.3 LTS
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: