Page 2 of 2

Re: SSD Caching with read/write

Posted: Sat May 18, 2019 1:08 pm
by CommonSenseAl
bokr71 wrote: Sat May 18, 2019 11:02 am I am not saying this is how it works. I am saying this is what the message from QNAP means. I also have seen it take a decent amount of time to turn caching off, which it says is due to the flushing of the write cache. But I think there is more than that going on...
Yes... something is going on. I'd just like a clear/good answer... which I haven't been able to get yet.

Re: SSD Caching with read/write

Posted: Wed Aug 28, 2019 6:44 am
by stettler
QNAP is using the flashcache linux kernel module from Facebook.

Dirty blocks (blocks that are in cache only) are synchronized to disk after 15 minutes of inactivity (no read/write of the block for 15 mins) or when 60% of the cache is used by dirty blocks.
dev.flashcache.CG0.fallow_delay = 900
dev.flashcache.CG0.dirty_thresh_pct = 60

Block are not synchronized at reboot/shutdown:
dev.flashcache.CG0.shutdown_fast_remove = 1

You can get info about the cache with:
more /proc/flashcache/CG0/flashcache_stats
dmsetup status CG0ssddev

To sync dirty blocks manually, set dev.flashcache.CG0.do_sync to 1:
sysctl -w dev.flashcache.CG0.do_sync=1

To enable sync at shutdown:
sysctl -w dev.flashcache.CG0.shutdown_fast_remove=0

(CG0 is the cache device name)

Re: SSD Caching with read/write

Posted: Fri Apr 30, 2021 11:26 pm
by bokr71
Did anyone ever get to a real answered on the question "when is SSD caching written to RAM and then to disk"? As CommonSenseAI mentioned, cache flushing takes ffoorreevveerr - literally on the 30th minute right now flushing my 1TB NVMe SSD cache...