Skip to content

Higher latency when falling back to EC2 credentials when generating large numbers of S3 Presigned URLs #3635

Answered by dscpinheiro
juphamzipit asked this question in Q&A

You must be logged in to vote

The SDK does cache credentials so it doesn't have to reach out to IMDS every time (you can see the logic here: https://github.com/aws/aws-sdk-net/blob/main/sdk/src/Core/Amazon.Runtime/Credentials/FallbackCredentialsFactory.cs) but the initial attempt may still result in throttles.

You can also enable debug logging to see exactly what the SDK is doing:

using Amazon;
using Amazon.Runtime;
using Amazon.Runtime.CredentialManagement;
using Amazon.S3;

AWSConfigs.LoggingConfig.LogTo = LoggingOptions.Console;
AWSConfigs.LoggingConfig.LogMetricsFormat = LogMetricsFormatOption.JSON;
AWSConfigs.LoggingConfig.LogResponses = ResponseLoggingOption.Always;
AWSConfigs.LoggingConfig.LogMetrics = true;

var 

Replies: 2 comments 2 replies

You must be logged in to vote
0 replies

You must be logged in to vote
2 replies
@juphamzipit

@dscpinheiro

Answer selected by ashishdhingra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants