Open mcamacho97 opened 3 days ago
@mcamacho97 Good morning. Lambda cold starts are expected for .NET runtime. One of the ways to reduce cold start time is to use Native AOT compilation.
You may also try to leverage new SnapStart
Lambda feature (however, please check pricing considerations).
Increasing memory size could help a bit, but cold start would still be an issue due to container initialization upon first request.
CC @normj for any additional inputs.
Thanks, Ashish
Describe the bug
Hello,
We have observed that Lambda functions using the .NET 8 runtime experience delays when fetching parameters from AWS Systems Manager Parameter Store. The delay ranges from 4 to 15 seconds, depending on the allocated memory size. This behavior is inconsistent and seems to be more pronounced during cold starts.
Regression Issue
Expected Behavior
We expect a consistent and faster response when fetching parameters from the Parameter Store, regardless of the memory configuration or cold/warm start scenarios.
Current Behavior
Below are the observed results during cold and warm starts for both multiple Parameter Stores and a single Parameter Store:
Cold Start (Full Path Parameter Store):
Warm Start (Full Path Parameter Store):
Cold Start (Specific Path Parameter Store):
Warm Start (Specific Path Parameter Store):
Reproduction Steps
Deploy the function and configure an appropriate IAM role with permission to access Parameter Store.
Use AWS Systems Manager Parameter Store to create parameters under both:
Test the Lambda function with different memory configurations (e.g., 128MB, 512MB, 1GB, 2GB) and log the results for both:
Possible Solution
No response
Additional Information/Context
We’ve also attached a graph visualizing the above results to provide more clarity. This issue seems closely tied to the allocated memory size and the runtime's handling of cold starts.
Key Questions:
Thank you for your assistance! Let us know if further details or tests are required.
AWS .NET SDK and/or Package version used
Amazon.Extensions.Configuration.SystemsManager 6.2.2 Amazon.Lambda.Core 2.2.0 Amazon.Lambda.Serialization.SystemTextJson v
Targeted .NET Platform
.NET 8
Operating System and version
.NET8 Lambda Runtime