-
Notifications
You must be signed in to change notification settings - Fork 862
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
Failure to set DefaultConfigurationMode causes performance issues during client construction #2022
Comments
I am seeing a similar issue. For me this manifests itself as a severe delay in startup performance when under load.
My solution so far is a _amazonDynamoDb.Config.Validate();
_amazonCloudWatch.Config.Validate(); |
+1. Cost me 4 hours of debugging Could do with documenting that this is necessary configuration if that is the case |
I recommend that it be set to Standard by default without needing to traverse an entire tree for 30 seconds to find the best thing to be. |
Sorry for the delay in the response, but do you still see the problem in the latest version of the |
@dscpinheiro I came across a reddit thread of someone running into this issue just last week so it's still an issue in v3. I noticed this codepath got rewritten in v4 so I assume it won't be an issue there. I can check again but if that getter behaviour hasn't been touched I should be able to reproduce it. |
We have made changes in V3 to avoid accidently triggering the |
Comments on closed issues are hard for our team to see. |
Describe the bug
This is a follow up to #1996 and is possibly related to #2000
Following an update to the SDK, the initial construction of the client on a network request increased to more than 30 seconds. I've spent some more time on this issue and my findings are below.
Expected Behavior
Client construction should be under 2 seconds.
Current Behavior
Client construction takes more than 30 seconds as you can see in the call tree:
Reproduction Steps
AWSSDK.Extensions.NETCore.Setup
+AWSSDK.S3
.appsettings.json
DefaultsMode
to be set.IAmazonS3
in a controller.Possible Solution
Stepping through the problem, the cause is this check:
aws-sdk-net/extensions/src/AWSSDK.Extensions.NETCore.Setup/ClientFactory.cs
Lines 238 to 240 in c957aa1
When the getter is called on
DefaultConfigurationMode
, if it hasn't already been set it and is not available locally, it ends up callingthis.DefaultConfiguration
which then results in the call tree above.Setting
"DefaultsMode": "Standard"
inappsettings
resolves the problem.DefaultsMode
/DefaultConfigurationMode
is not well documented in regards to the .NET SDK and I don't see it in the examples, thus I would consider this unexpected behavior for the majority of consumers.Additional Information/Context
No response
AWS .NET SDK and/or Package version used
AWSSDK.S3 3.7.9.2
AWSSDK.Extensions.NETCore.Setup 3.7.2
Targeted .NET Platform
.NET 6
Operating System and version
Windows 11
The text was updated successfully, but these errors were encountered: