Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

I have been comparing multiple cache filesystems, i am wondering what if anything can be done to speed this up a bit. #5

Closed
Jieiku opened this issue Oct 13, 2018 · 5 comments

Comments

@Jieiku
Copy link

Jieiku commented Oct 13, 2018

I have been comparing multiple cache filesystems, i am wondering what if anything can be done to speed this up a bit.

I have tried just about all the cache filesystems I could find for linux, so far pcachefs and mcachefs are the only ones that seem to work for my needs. (sshfs and caches metadata)

pcachefs has one up on mcachefs, in that it only "caches data as it is read, and only the bits that are read."

That is good because when checking metadata on files mcachefs would cache the entire file, whereas with pcachefs it caches only what im actually trying to access.

mcachefs on the other hand gave me considerably more speed. (max possible speed is 20 Mb/s because of connection speed.)
mcachefs I average 17-18 Mb/s
pcachefs I average 13-14 Mb/s

another thing I noticed is that when I access a single file with pcachefs it has 2 file descriptors listed (both 3r and 4r):
sudo lsof -c sshd | grep chroot
sshd 25361 admin007 3r REG 0,77 5088803573 205127900 /chroot/admin007/remotefs/3Drender.mkv
sshd 25361 johnwick 4r REG 0,77 5088803573 205127900 /chroot/admin007/remotefs/3Drender.mkv

with mcachefs, it will only use a single file descriptor per accessed file, and I am wondering why this is:
sudo lsof -c sshd | grep chroot
sshd 25361 admin007 3r REG 0,77 5088803573 205127900 /chroot/admin007/remotefs/3Drender.mkv

@ibizaman
Copy link
Owner

First of all, thanks for looking into this project.

You won't like this, but you probably guessed from the last commit date that this project is not really maintained.

On top of that, I just checked mcachefs and it seems much more advanced than pcachefs.

Now to answer the speed question, my first guess would be mcachefs is written in c, but also mcachefs received much more love than this project.

For the inode question, actually I have no idea without looking more into the code.

@ibizaman
Copy link
Owner

If I would come back to this project, I'd actually rewrite it from scratch in Rust using probably https://github.com/zargony/rust-fuse.

There's also this project which could be a better starting point, in c: https://github.com/noahdesu/fusell-seed

@Jieiku
Copy link
Author

Jieiku commented Oct 13, 2018

Thanks for the response, here is a list of the ones I tried out, I am currently using mcachefs primarily because of how much more throughput I get with it, just need to see if I can figure out a way to prevent it from cacheing entire files when its not necessary.

mcachefs - c/c++, works, but sometimes caches entire files, when all I really was after was a few bytes
pcachefs - python, seems to work, slightly slower than direct, lsof shows 3r & 4r

CacheFS - python, no metadata/slow, last updated 2011
catfs - Rust, no metadata/slow, tries to copy entire file before playback
FS-Cache - no metadata/slow, does not seem to support sshfs, NFS only, which could be tunneled over ssh, but BLEH
fuse-cache - too basic, caches entire directories instead of on OPEN/READ

@Jieiku Jieiku closed this as completed Oct 13, 2018
@kahing
Copy link

kahing commented Oct 13, 2018

catfs author here. I need to update the readme, catfs no longer copies the entire file before returning the first byte. But yes still no metadata cache

@Jieiku
Copy link
Author

Jieiku commented Oct 13, 2018

Thanks for the response! I appreciate that, I opened a issue over at your project so I could discuss with you what I experienced. kahing/catfs#21

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants