s3fs 将 Amazon S3 存储桶挂载为本地目录的稳定性如何 [英] How stable is s3fs to mount an Amazon S3 bucket as a local directory

查看:45
本文介绍了s3fs 将 Amazon S3 存储桶挂载为本地目录的稳定性如何的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

s3fs 将 Amazon S3 存储桶挂载为 linux 中的本地目录的稳定性如何?对于高需求的生产环境是否推荐/稳定?

How stable is s3fs to mount an Amazon S3 bucket as a local directory in linux? Is it recommended/stable for high demand production environments?

有没有更好/类似的解决方案?

Are there any better/similar solutions?

更新:使用 EBS 并通过 NFS 将其挂载到所有其他 AMI 会更好吗?

Update: Would it be better to use EBS and to mount it via NFS to all other AMIs?

推荐答案

有这里有一篇关于 s3fs 的好文章,阅读后我求助于 EBS 共享.

There's a good article on s3fs here, which after reading I resorted to an EBS Share.

它强调了使用 s3fs 时的一些重要注意事项,即与 S3 的固有限制相关的:

It highlights a few important considerations when using s3fs, namely related to the inherent limitations of S3:

  • 任何文件都不能超过 5GB
  • 您无法部分更新文件,因此更改单个字节将重新上传整个文件.
  • 对许多小文件的操作非常高效(毕竟每个都是一个单独的 S3 对象)但大文件效率非常低
  • 虽然 S3 支持部分/分块下载,但 s3fs 没有利用这一点,因此如果您只想读取 1GB 文件的一个字节,则必须下载整个 GB.

因此,s3fs 是否可行取决于您存储的内容.如果您要存储比方说的照片,您想要写入整个文件或读取整个文件的位置永远不会增量更改文件,那么它很好,尽管有人可能会问,如果您正在这样做,那么为什么不直接使用 S3 的API 直接?

It therefore depends on what you are storing whether s3fs is a feasible option. If you're storing say, photos, where you want to write an entire file or read an entire file never incrementally change a file, then its fine, although one may ask, if you're doing this, then why not just use S3's API Directly?

如果您在谈论应用程序数据(例如数据库文件、日志文件),您想在其中进行小的增量更改,那么它绝对不可以 - S3 只是不能那样工作,您无法增量更改文件.

If you're talking about appliation data, (say database files, logging files) where you want to make small incremental change then its a definite no - S3 Just doesn't work that way you can't incrementally change a file.

上面提到的文章确实讨论了一个类似的应用程序 - s3backer - 它通过实现一个S3 上的虚拟文件系统.这解决了性能问题,但它本身也有一些问题:

The article mentioned above does talk about a similar application - s3backer - which gets around the performance issues by implementing a virtual filesystem over S3. This gets around the performance issues but itself has a few issues of its own:

  • 由于延迟写入,数据损坏的风险很高
  • 太小的块大小(例如,默认 4K)会增加显着的额外费用(例如,50GB 的 4K 块存储空间需要 130 美元)
  • 太大的块大小会增加大量的数据传输和存储费用.
  • 内存使用量可能令人望而却步:默认情况下,它缓存 1000 个块.
    默认的 4K 块大小不是问题,但大多数用户
    可能想要增加块大小.

我求助于从 EC2 实例共享的 EBS Mounted Drived.但是你应该知道,虽然性能最好的选项它有一个大问题EBS 挂载 NFS 共享有其自身的问题——单点故障;如果共享 EBS 卷的计算机出现故障,那么您将无法访问所有访问该共享的计算机.

I resorted to EBS Mounted Drived shared from an EC2 instance. But you should know that although the most performant option it has one big problem An EBS Mounted NFS Share has its own problems - a single point of failure; if the machine that's sharing the EBS Volume goes down then you lose access on all machines which access the share.

这是我能够承受的风险,也是我最终选择的选项.我希望这会有所帮助.

This is a risk I was able to live with and was the option I chose in the end. I hope this helps.

这篇关于s3fs 将 Amazon S3 存储桶挂载为本地目录的稳定性如何的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆