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

[CRT] - Allow setting max bandwidth limit for S3 transfers #8974

Open
1 task
chipitsine opened this issue Oct 15, 2024 · 4 comments
Open
1 task

[CRT] - Allow setting max bandwidth limit for S3 transfers #8974

chipitsine opened this issue Oct 15, 2024 · 4 comments
Labels
configuration feature-request A feature should be added or improved. p2 This is a standard priority issue s3

Comments

@chipitsine
Copy link

chipitsine commented Oct 15, 2024

Describe the bug

I'm trying to limit S3 bandwidth for CRT runtime described in https://aws.amazon.com/blogs/storage/improving-amazon-s3-throughput-for-the-aws-cli-and-boto3-with-the-aws-common-runtime/

I used the following command (from the article)

aws configure set s3.target_bandwidth 50MB/s

despite that I see much higher bandwidth (limited by hard disk drive actually)

image

aws cli version: aws-cli/2.17.61 Python/3.12.6 Windows/2022Server exec-env/EC2 exe/AMD64

in classic (non crt) mode bandwidth limiting works like a charm.

Regression Issue

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

Expected Behavior

limiting bandwidth in crt mode

Current Behavior

not limiting (even configured as per article)

Reproduction Steps

install aws cli
aws configure set s3.preferred_transfer_client crt
aws configure set s3.target_bandwidth 50MB/s

copy files to s3, verify speed

Possible Solution

No response

Additional Information/Context

No response

CLI version used

aws-cli/2.17.61 Python/3.12.6 Windows/2022Server exec-env/EC2 exe/AMD64

Environment details (OS name and version, etc.)

win 2022

@chipitsine chipitsine added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 15, 2024
@chipitsine chipitsine changed the title (short issue description) s3: configuring bandwidth for crt runtime dows not work as documented Oct 15, 2024
@chipitsine chipitsine changed the title s3: configuring bandwidth for crt runtime dows not work as documented s3: configuring bandwidth for crt runtime does not work as documented Oct 16, 2024
@tim-finnigan tim-finnigan self-assigned this Oct 18, 2024
@tim-finnigan tim-finnigan added investigating This issue is being investigated and/or work is in progress to resolve the issue. s3 configuration labels Oct 18, 2024
@tim-finnigan
Copy link
Contributor

tim-finnigan commented Oct 21, 2024

Thanks for reaching out. I could reproduce the behavior you described. This issue was discussed further internally and the takeaway was that the target_bandwidth configuration for CRT is a hint of how much resources it should allocate and is not an active threshold that the CRT tries to maintain, so in practice it is possible for exceed the target threshold.

The CRT doesn't currently have a way to force bandwidth to stay under a certain limit (such as the max_bandwidth config for the classic transfer client.) Also the documentation for target_bandwidth notes that it "controls the target bandwidth that the transfer client will try to reach for S3 uploads and downloads." It is not guaranteed to be precise and cannot force the bandwidth to stay under a max limit.

But the CLI team has acknowledged the request to support configuring some kind of bandwidth throttling or upper bound on the concurrency/throughput so that other processes can still run. So I will update this issue as a feature request to track. The current documentation could also be potentially improved for clarity. If you have any other questions or feedback please let us know. In the meantime you can use the classic transfer client, or consider trying other options such as using DataSync and setting a bandwidth limit for an S3 transfer.

@tim-finnigan tim-finnigan added feature-request A feature should be added or improved. p2 This is a standard priority issue and removed bug This issue is a bug. investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged. labels Oct 21, 2024
@tim-finnigan tim-finnigan changed the title s3: configuring bandwidth for crt runtime does not work as documented [CRT] - Allow setting max bandwidth limit for S3 transfers Oct 21, 2024
@tim-finnigan tim-finnigan removed their assignment Oct 21, 2024
@chipitsine
Copy link
Author

I tried running with "--debug" option, I did not find any evidence of trying to reach target bandwidth. How can I see whether is it trying or not ?

image

@chipitsine
Copy link
Author

chipitsine commented Oct 21, 2024

I tried to find reference to "target_bandwidth" in https://github.com/awslabs/aws-c-s3

I wanted to have a look at the code

image

@tim-finnigan
Copy link
Contributor

You can find target_bandwidth in the AWS CLI codebase. When you are looking at logs with --debug it should be reflected in s3transfer.crt - DEBUG - Using CRT throughput target in gbps: 0.4194304. For questions regarding the CRT code specifically feel free to open an issue or Discussion in that repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration feature-request A feature should be added or improved. p2 This is a standard priority issue s3
Projects
None yet
Development

No branches or pull requests

2 participants