Closed scionwest closed 2 years ago
Thanks for the feedback on this issue. We would like to continue improving the modularity of our packages and improving build/cold start times. In this area, DynamoDB is certainly a high priority.
We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.
If I bring the AWSSDK.DynamoDbV2 package into a
netcoreapp3.0
project and deploy it to Lambda I'm seeing it increase my cold start times by 2 seconds.I have an example project that can be used to reproduce this. You just need to deploy it using
dotnet lambda deploy-serverless
, insert the following JSON object into the DynamoDb table it generated and make a request to/accounts/838d18ec-127d-4c96-af67-0556a346c114
Expected Behavior
When adding your package to an existing project I would expect it to not increase cold-start times of my Lambda by 2 full seconds.
Current Behavior
I'm using the Convey Microservice framework instead of Microsoft's MVC framework for Rest services. Launching a Lambda with a Convey endpoint returning in-memory generated data takes 4.4 seconds on average for a cold-start. If I add the AWSSDK.DynamoDbV2 package and run a
GetItem
request against a DynamoDB table the cold-start increases from 4.4 seconds to between 6.5 and 7.1 seconds from my tests.Warm starts don't seem to be an issue. I see an increase of about 15ms on warm starts which isn't bad.
Steps to Reproduce (for bugs)
dotnet lambda deploy-serverless
/accounts/838d18ec-127d-4c96-af67-0556a346c114
endpoint to cold-start the lambda and resolve the DynamoDb client.Context
It's generally known the aspnetcore and Lambda are rough when it comes to cold-starts for public facing APIs. I've seen a lot of this being related to how aspnetcore handles it's dependency tree. Moving to another middleware framework for http request processing that is lighter weight helps with the cold-start. The point of this however is defeated when Amazon's SDK packages severely impact the cold-starts on their own.
Your Environment
.NET Core Info
dotnet lambda deploy-serverless
dotnet --info
:Runtime Environment: OS Name: Windows OS Version: 10.0.17763 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.0.100\
Host (useful for support): Version: 3.0.0 Commit: 7d57652f33
.NET Core SDKs installed: 2.1.802 [C:\Program Files\dotnet\sdk] 2.2.402 [C:\Program Files\dotnet\sdk] 3.0.100 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]