是否可以使用带有 FUSE 文件系统的 Linux VFS 缓存?
默认情况下,Linux VFS 缓存似乎不适用于 FUSE 文件系统。例如,“read”调用似乎被系统地转发到 FUSE 文件系统。
我在 FUSE 特定的远程文件系统上工作。我需要一个非常积极的缓存。
我需要实现自己的页面缓存吗?或者是否可以为这个特定的 FUSE 文件系统激活 Linux VFS 缓存?或者有人知道一个好的代理/缓存 FUSE 文件系统(或者一种不需要重新发明轮子就能做到这一点的 C 库)?
额外问题:
如果我必须实现自己的页面缓存,我想使用 REDIS 守护进程来执行 LRU 操作。我几乎确信它是缓存元数据的一个不错的选择。但对于页面,我不确定它是否会比简单的本地目录(带有 VFS 缓存)或 /dev/shm 更好。但我会失去LRU自动清理。有人知道一种具有自动 LRU 清理功能的 /dev/shm 吗?
一些附加信息:文件系统是只读的,远程端几乎是不可变的;远程端包含非常大的文件,我无法将其复制到本地目录。
It seems that the Linux VFS cache does not work by default with a FUSE filesystem. For example, the "read" call seems to be systematically forwarded to the FUSE filesystem.
I work on a FUSE specific remote filesystem. I need a very aggressive cache.
Do I need to implement my own page cache? Or is it possible to activate the Linux VFS cache for this particular FUSE filesystem? Or does someone know a good proxy/cache FUSE filesystem (or a kind of C library to do that without reinventing the wheel)?
Bonus question:
If I have to implement my own page cache, I think to use a REDIS daemon to do the LRU stuff. I'm nearly sure that it can be a good option for caching metadata. But for pages, I'm not sure that it will be better than a simple local directory (with VFS cache) or than /dev/shm. But I will lose LRU automatic cleaning. Does someone know a sort of /dev/shm with automatic LRU cleaning?
Some additional information: the filesystem is read-only and the remote side is nearly immutable; the remote side contains very big files that I can't copy to a local directory.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 FUSE
auto_cache
选项。 FUSE 将缓存数据,并且仅进行几次元数据调用来检查文件大小或修改时间戳是否已更改。You can use the FUSE
auto_cache
option. FUSE will cache the data and only make several metadata calls to check if the file size or modification timestamp has changed.我认为 VFS 缓存在 FUSE 上不起作用。 FUSE 有缓存解决方案,您也可以实施自己的解决方案。
经过一番小搜索,我发现了 fuse-cache;他们声称这很简单。
I think VFS cache will not work on FUSE. There are caching solutions for FUSE or you can implement yours.
With a small search, I found fuse-cache; they claim that it is simple.