Doloops / mcachefs

mcachefs : Simple filesystem-based file cache based on fuse
64 stars 15 forks source link

Viewing the log? #7

Open dgrnbrg opened 5 years ago

dgrnbrg commented 5 years ago

Hello, I am using mcachefs, and sometimes it seems to crash. I'm not sure how to configure it to write logs, or where they are written to, so that I can understand why this is happening. Thank you!

hradec commented 5 years ago

do a ls -l /mcachefs_filesystem/.mcachefs/

You'll see a bunch of files there... and you can monitor the content of those files to figure what mcachefs is doing!

the best for me is the /mcachefs_filesystem/.mcachefs/transfer, which will show you what's being currently transferred from the backend, the transfer speed, and best of all, the QUEUE of files mcachefs has to still transfer!!

another nice one is /mcachefs_filesystem/.mcachefs/journal, which will show all the local changes done to the filesystem.

If mcachefs is hanging for a long time for you, it's probably transferring files!! Check the .mcachefs/transfer file and you'll probably see it!

But there's still sometimes when mcachefs just hangs, and looks like it's not transferring data and there's no cpu usage as well, apparently doing nothing, and there's no info on any of the .mcachefs/* files that would indicate what's going on.

Although, those type of hangs don't take long as when transferring data from the backend (usually 2-5 seconds for me), they usually happen when I access an area of the backend that I never accessed before (and I do get 2-5 seconds hangs when listing the backend directly, so I just assume it's because mcachefs is actually consulting the backend fs)... BUT, very rarely, I got hangs when listing a folder that I known for sure is already cached, and debug messages would be nice to known why.

So that's why I'm also looking for a way to show the debug information (I saw a bunch of debug messages in the code, so there's probably an obscure way to make then show up somewhere, somehow) and when I find, I'll let you known! ;)

hradec commented 5 years ago

found it.

if you run mcachefs with the fuse argument -f, you'll see a nice log!

if you edit the Makefile, you can comment out the current CFLAGS line and uncomment the one with -DDEBUG in it... run make clean ; make to do a full rebuild and when you run mcachefs with -f you should see even more log!

when running with -f, you can combine it with fuses -s, to run it in a single thread (so the log will be more linear) and last but not least, fuses -d, which turns FUSE debug on... so you'll see fuse debug together with the log!