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

s3 sync uses high CPU when wrapped with trickle to limit bandwidth #1078

Closed
jkrauska opened this issue Jan 2, 2015 · 5 comments
Closed

s3 sync uses high CPU when wrapped with trickle to limit bandwidth #1078

jkrauska opened this issue Jan 2, 2015 · 5 comments

Comments

@jkrauska
Copy link

jkrauska commented Jan 2, 2015

I am attempting to use trickle [1] to limit the upload speed an 'aws s3 sync' uses.

My ISP will charge me for overages if I go above 20Mbps, so I need to limit the throughput.

I have had good luck with trickle in the past for simpler things like ftp, but it seems there's something about how mutlipart uploads work that doesn't play nicely? Eventually several threads begin to get stuck at 100% CPU utilization.

How I'm calling aws-cli:
nice trickle -s -u $UPLIMIT aws s3 sync --recursive $EXCLUDES ${BACKUPDIR}/$dirname s3://${S3BUCKET}/$dirname

With an $UPLIMIT of about 2500 (in KB/s) to give under 20Mbps.

Please advise? Perhaps you have a bwlimit feature in your roadmap for the s3 sync?

  1. http://monkey.org/~marius/pages/?page=trickle
@jamesls
Copy link
Member

jamesls commented Jan 13, 2015

I think this is a great feature request. I've filed #1090 to track this. I tried out trickle with the latest version of the CLI, and it appears to work for me. I didn't see any 100% cpu utilization. I'd try again with the latest version of the AWS CLI.

However, long term, I think we're going to just add support directly in the AWS CLI for limiting bandwidth, which we can track over in #1090.

@jamesls jamesls closed this as completed Jan 13, 2015
@lkjangir
Copy link

Hi Jamesls,
i am using the latest version of aws cli and what i see during the upload that both s3 cp and s3 sync are consuming all CPU and memory. My current server has 16 GB and s3 sync has consumed all 100% CPU and RAM. is there any solution for this, please let me know.

@bobintetley
Copy link

I had the same issue. If you set the time-smoothing and length-smoothing to higher values, trickle will use a lot less CPU.

nice trickle -s -t 5 -l 20 -u $UPLIMIT

worked well for me and reduces CPU usage from 100% down to about 0.7%. The default time smoothing is very aggressive at 0.1 seconds and I think to blame for the high CPU usage.

@bobintetley
Copy link

Oh, and that doesn't fix the thread sticking issue, to do that use aws configure to limit to a single thread with:

aws configure set default.s3.max_concurrent_requests 1

@xoroz
Copy link

xoroz commented Oct 30, 2017

Try reducing the max_concurrent_requests
http://docs.aws.amazon.com/cli/latest/topic/s3-config.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants