SSD Caching with read/write

Questions about SNMP, Power, System, Logs, disk, & RAID.
Starting out
Posts: 11
Joined: Thu May 09, 2019 3:11 am

Re: SSD Caching with read/write

Post by CommonSenseAl » Sat May 18, 2019 1:08 pm

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.

Starting out
Posts: 12
Joined: Thu May 08, 2008 11:50 pm

Re: SSD Caching with read/write

Post by stettler » Wed Aug 28, 2019 6:44 am

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)

Post Reply

Return to “System & Disk Volume Management”