3

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.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Fabien
  • 178
  • 1
  • 7

2 Answers2

2

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.

J. Har
  • 21
  • 2
1

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.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Samet Atdag
  • 982
  • 6
  • 21
  • Thanks for your reply. But fuse-cache is not good for me because I have very big files on the remote side that I can't simply copy to a local directory. I need a cache at the page level because the cient side open only specific parts of these big files. – Fabien Dec 30 '10 at 09:03
  • 1
    Then it seems it is hard to find a generic solution. Try to implement yours. – Samet Atdag Dec 30 '10 at 09:07