简体   繁体   English

AWS S3上传/下载占用内存少的大型文件

[英]AWS S3 uploading/downloading huge files with low memory footprint

Suppose we have an app that has very limited memory but has to upload/download huge files to AWS s3. 假设我们有一个内存非常有限的应用程序,但必须将大文件上传/下载到AWS s3。

Question 1 : what is the correct api to use when we need to upload/download directly to FS while having very limited memory? 问题1:当我们需要在内存非常有限的情况下直接上传/下载到FS时,使用什么正确的api? (like 200Mb) (例如200Mb)

One of the options to upload object to s3 is this 其中一个选项上传对象S3是这个

TransferManager.upload(String bucketName, String key, File file)

Question 2 : will TransferManager.upload() put entire file into the memory or it is smart enough to stream content to s3 without filling up the memory? 问题2:TransferManager.upload()是否会将整个文件放入内存中,或者它足够聪明以将内容流式传输到s3而不会填满内存?

Question 3 : do we have any api that can do zero copy networking ? 问题3:我们是否有可以进行零拷贝联网的任何api?

Question 4 : aws offers option to move files from s3 to slower storage if you define the policy, if the file is moved to low frequency access storage do we query it the same way? 问题4:如果您定义了策略,aws提供了将文件从s3移至速度较慢的存储的选项,如果文件已移至低频访问存储,我们是否以相同的方式查询它? (my assumption is that s3 will block me for hours to get the file then my download will start) important thing is if this process is hidden for me as a client or i need to figure out where my file is now and use the specific api to get it? (我的假设是s3会阻止我几个小时来获取文件,然后我才能开始下载)。重要的是,如果该过程作为客户端对我来说是隐藏的,或者我需要弄清楚我的文件现在在哪里,并使用特定的api为拿到它,为实现它?

Pardon me for many questions, searched answers for while, found only bits and pieces but no explicit answers. 请原谅我许多问题,搜索了一段时间的答案,只发现了点点滴滴,但没有明确的答案。

Q1, Q2: Dig for a multi-part S3 upload, that is what you are looking for. Q1,Q2:挖掘多部分的S3上传内容,这就是您所需要的。

Q3: Nope, S3 supports only standard and multi-part upload APIs for now. 问题3:不,S3目前仅支持标准和多部分上传API。

Q4: No, it is working other way. Q4:不,它在以其他方式工作。 For you, it will look like the file is stored normally and you will have access to it as soon as you uploaded it (several seconds), but the difference is in the price. 对于您来说,看起来文件已正常存储,并且您在上载后(几秒钟)就可以访问该文件,但区别在于价格。 It will be much more cheaper for you to store data, but more expensive to retrieve every MB. 对于您来说,存储数据将更加便宜,但是检索每个MB则更加昂贵。

Good luck 祝好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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