Title
AWS re:Invent 2023 - Getting the most performance for your .NET apps from AWS SDK for .NET (XNT401)
Summary
- Norman Johanson, a Principal Engineer at AWS, focuses on .NET tooling for AWS applications.
- The session covers performance optimization techniques for the AWS SDK for .NET.
- The AWS SDK for .NET is a family of NuGet packages with a consistent programming model across AWS services.
- The SDK has been stable over the years, with the current major version being version 3.
- Key recommendations include reusing service clients, caching credentials, and understanding the SDK's default behavior.
- The SDK caches HTTP clients to reduce TLS negotiation overhead, but this can be customized or disabled.
- The Security Token Service (STS) defaults to the US East 1 region, but this can be changed to reduce latency and dependency on multiple regions.
- The SDK's retry behavior is configurable, with a new adaptive retry mode that adjusts to throttling errors.
- High-level libraries for DynamoDB have been updated to improve startup times by avoiding describe table calls.
- S3 streaming support has been improved to handle non-seekable streams by buffering in chunks.
- Native AOT support in .NET 8 allows for faster cold start performance in Lambda functions, but requires careful handling of dependencies and trimming.
- The AWS SDK for .NET version 3.7.300 addresses trim warnings and adds a .NET 8 target, but some features are not yet supported in Native AOT.
- Feedback and contributions to the SDK are encouraged via GitHub.
Insights
- Reusing service clients and caching credentials are critical for performance and avoiding unnecessary network calls.
- The SDK's default behavior, such as caching HTTP clients and defaulting STS to US East 1, is designed for backward compatibility but can be overridden for performance gains.
- The adaptive retry mode is a significant feature for handling throttling errors gracefully and maintaining application performance.
- The recent updates to high-level libraries, particularly for DynamoDB, can significantly improve startup times, which is crucial for serverless applications like AWS Lambda.
- The support for S3 streaming with non-seekable streams is a valuable addition for web applications handling large file uploads.
- Native AOT support in .NET 8 offers promising cold start performance improvements for Lambda functions, but it requires careful consideration of the SDK's limitations and proper testing.
- The AWS SDK for .NET's move to address trim warnings and add a .NET 8 target shows a commitment to staying current with .NET developments and improving performance for serverless applications.
- The session emphasizes the importance of community feedback in guiding the future development of the AWS SDK for .NET, particularly in areas like Native AOT support.