Limiting S3 Sync Bandwidth

September 10, 2019

Out of the box the aws s3 application is suppose to limit bandwidth by setting the “s3.max_bandwidth” option.

Example:

aws configure set default.s3.max_bandwidth 5MB/s

Problem

aws s3 sync is using more bandwidth than the ~/.aws/config file has specified.

Replication Steps

Run the following command to set a max bandwidth limit for the s3 application

aws configure set default.s3.max_bandwidth 5MB/s

Start the sync

aws s3 sync /foo s3://bar

Monitor the bandwidth with nload

nload

Expected Result

nload should show that no more than 5MB/s (40 Mbps) of bandwidth is being used

Actual Result

The s3 application is consuming almost 37.5 MB/s (300 Mbps)

Solution

The reason that this is happening is that the aws config option to limit bandwidth is thread based.

You must change your concurrent threads to 1:

aws configure set default.s3.max_concurrent_requests 1