是否可以使用带有 FUSE 文件系统的 Linux VFS 缓存?

发布于 2024-10-09 08:08:32 字数 468 浏览 0 评论 0原文

默认情况下,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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

街道布景 2024-10-16 08:08:32

您可以使用 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.

土豪 2024-10-16 08:08:32

我认为 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文