-
Notifications
You must be signed in to change notification settings - Fork 200
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
simple queue handler / cloud function takes longer than expected #4125
Comments
actually not sure if it's the init part. To run this successfully it needs a timeout of more than 10 seconds.
So, perhaps there's something else going on. But it's happening for a few days already, so I don't believe it's AWS related. |
Seems like a regression of https://github.com/winglang/wing/releases/tag/v0.29.6 - so likely #4109 Running the example above with 0.29.5with 0.29.6 |
Nice catch @skorfmann Related - I just had a short discussion with @eladb on #4109 where he pointed out something that passed under my radar; |
Apparently, the embedded version of aws-sdk v3 in Node 18 is not well optimized. There is a recommendation to deploy the Lambda with the necessary aws-sdk v3 objects. In general, Lambdas require specific modules (e.g., @aws-sdk/client-dynamodb). My question is whether, during the bundling process, we are only including what is necessary or the entire library? |
Esbuild should be bundling the necessary code parts only |
then maybe its better bundling the aws-sdk v3 again, code will be urge but run faster |
I did a quick test here, using Node.js 18 without adding the aws-sdk v3 library, using the one already available in Lambda. When I upload the code with the aws-sdk v3 library, the execution time drops to 2.3 seconds. @staycoolcall911 it's better to include the SDK in the object again |
Thanks @marciocadev - I guess we should go back to inline the awssdk code in the lambda then. |
Bundling aws-sdk v3 again, removing the library made the execution slower Closes #4125 ## Checklist - [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted) - [x] Description explains motivation and solution - [ ] Tests added (always) - [ ] Docs updated (only required for features) - [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
Congrats! 🚀 This was released in Wing 0.29.20. |
I tried this:
see example
wing test -t tf-aws main.w
This happened:
The queue handler is timing out - it actually takes almost 10 seconds for this function to succeed (see comment below)
I expected this:
It should not time out, it did work two weeks ago
Is there a workaround?
increase the timeout / add more resources to the function
Component
SDK
Wing Version
0.29.11
Node.js Version
20.6.0
Platform(s)
MacOS
Anything else?
No response
Community Notes
The text was updated successfully, but these errors were encountered: