简体   繁体   中英

Why amazon s3 cli copy much faster than java sdk in the same bucket?

I have a file in s3 bucket say like s3://prefix/file1 with size 2G I tried to copy it to s3://prefix/file2

The CLI I used is aws s3 cp s3://prefix/file1 s3://prefix/file2

The sdk usage is amazonS3.copyObject("prefix","file1","prefix", "file2")

CLI method took ~15s while sdk method took ~30s.

Try to use the TransferManager, like in this "old" blog post of AWS: https://aws.amazon.com/de/blogs/developer/using-transfer-manager-to-copy-amazon-s3-objects/

I'm not very familiar with JAVA programming, but in several applications I've been involved in migrating/optimizing, switching from the "normal" SDK methods to operations using TransferManager with Java has sometimes helped improve performance.

Maybe this could also improve the performance for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM