Skip to content
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

High CPU Usage in S3 Java SDK Due to Excessive URL Parsing and Exception Stack Trace Generation During getObject Requests #5846

Open
1 task
jasonstack opened this issue Jan 31, 2025 · 0 comments
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@jasonstack
Copy link

jasonstack commented Jan 31, 2025

Describe the bug

We are using software.amazon.awssdk:S3:2.29.21: DefaultS3AuthSchemeProvider#resolveAuthScheme seems to parse the String endpoint on every request and catching exceptions when some endpoint rule is mismatched in DefaultS3EndpointProvider#endpointRule64.

This is how we configure the client.

        S3CrtAsyncClient.builder()
                .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKey, secretKey))
                .retryConfiguration(b -> b.numRetries(3))
                .checksumValidationEnabled(true)
                .forcePathStyle(true)
                .endpointOverride(URI.create(endpoint));

Attached CPU profile:

Image

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Avoid parsing URL and filing stacktrace on endpoint rule mismatch per request

Current Behavior

Parsing URL on every request and filling stacktrace when endpoint rule mismatches

Reproduction Steps

Run getObjects request

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

2.29.21

JDK version used

21

Operating System and version

Ubuntu

@jasonstack jasonstack added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant