使用TransferManager来上传大量小型对象

huangapple go评论77阅读模式
英文:

Using TransferManager for uploading a large number of small sized objects

问题

我有大量的文件(约100万个),每个文件大小约为2KB。我目前正在使用Java中的s3Client的PutObject方法将每个文件上传到S3存储桶。但是所有文件的上传时间非常长(约4-5小时)。我已经了解了TransferManager,知道它可以用于使用multipart上传大文件。但这适用于至少5MB大小的文件,不符合我的用例。是否有办法可以使用TransferManager来提高上传速度?如果不能,我还能做些什么?

英文:

I have a large number of files (~ 1 million) and each of them is around 2KB in size. I am currently using s3Client's PutObject method in Java. to upload each of the file to an s3 bucket. But the upload for all the files is taking very long (~ 4-5 hours). I have read about TransferManager and know that it can be used to upload large sized objects using multipart. But this is for files that are atleast 5MB in size which does not satisfy my use case. Is there any way I can use TransferManager to increase the upload speed? If not, what else can I do?

答案1

得分: 1

如果您正在使用HTTPS请求上传文件,可以尝试使用多个前缀,还可以拥有多个应用程序的副本,以便分担负载并减少时间。另一种解决方案是,如果您未来不打算读取单个文件,可以将数据分成多个部分并进行上传。您也可以参考AWS文档。
AWS S3性能优化

英文:

If you are using https requests to upload your file, you can try using multiple prefixes, also you can have multiple replicas of the application so that load can be divided and time will decrease. Other solution is if you are not intending to read individual file in future, you can zip the data in multiple part and upload. You can refer aws docs also.
aws s3 performance optimization

huangapple
  • 本文由 发表于 2020年7月29日 14:41:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/63147750.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定