Page 1 of 2

SSD Caching with read/write

Posted: Thu May 09, 2019 3:23 am
by CommonSenseAl
I have an extra bay in my TS-453mini that I put an Intel 545s SSD in there to try SSD caching.

Well... I'm bummed. I want a read/write cache but it warned me about data loss if I used a single SSD as a write cache.

Well, I thought, no big deal as long as it flushes the write cache when the system goes idle... plus Intel SSDs should be reliable enough and the SMART data should help warn me when the SSD is going to fail.

BUT.... there is no indication of how and when it flushes the data from the write cache to the RAID array... and I see no config options to control how this is done.

I would definitely use SSD caching if the NAS would frequently flush any write data to the RAID array (like when it went mostly idle). I don't want the data sitting on the SSD for hours or days or weeks without being flushed.

So...

1. When does it flush the write cache data?
2. Do I have any control over flushing the write cache?
3. Will it leave write-cached data on the SSD for hours and/or days and/or weeks without flushing?

UPDATE: Also see:
viewtopic.php?f=24&t=148431

Re: SSD Caching with read/write

Posted: Thu May 09, 2019 7:17 pm
by storageman
Irrelevant, whether it leaves it in cache for 2 mins to 2 days, you can still get data corruption if it fails.
Hence need for two.

Re: SSD Caching with read/write

Posted: Thu May 09, 2019 10:15 pm
by CommonSenseAl
storageman wrote: Thu May 09, 2019 7:17 pm Irrelevant, whether it leaves it in cache for 2 mins to 2 days, you can still get data corruption if it fails.
Hence need for two.
You can still get data corruption with two should they both fail.

Re: SSD Caching with read/write

Posted: Thu May 09, 2019 10:18 pm
by storageman
CommonSenseAl wrote: Thu May 09, 2019 10:15 pm
storageman wrote: Thu May 09, 2019 7:17 pm Irrelevant, whether it leaves it in cache for 2 mins to 2 days, you can still get data corruption if it fails.
Hence need for two.
You can still get data corruption with two should they both fail.
Well hopefully they don't fail together and you swopout the first one that fails before the second one does!
It's all your decision.

Re: SSD Caching with read/write

Posted: Thu May 09, 2019 10:21 pm
by CommonSenseAl
storageman wrote: Thu May 09, 2019 10:18 pm Well hopefully they don't fail together and you swopout the first one that fails before the second one does!
It's all your decision.
Yes, it's my decision.

And I want to use one SSD and have it flush frequently enough so that data does not stay only in the cache for hours or days or weeks... that is an acceptable risk to me. So back to my original question.

UPDATE: Also see:
viewtopic.php?f=24&t=148431

Re: SSD Caching with read/write

Posted: Thu May 09, 2019 10:31 pm
by storageman
You can't - system decides.

And I can't see Qnap changing that.

If you want to force a flush run "Check File System" - that would do it, but also take your volume offline temporarily so not something to do lightly.

Re: SSD Caching with read/write

Posted: Thu May 09, 2019 10:36 pm
by CommonSenseAl
storageman wrote: Thu May 09, 2019 10:31 pm You can't - system decides.

And I can't see Qnap changing that
Thanks.

Do you have any idea how the system decides?

Re: SSD Caching with read/write

Posted: Thu May 09, 2019 10:37 pm
by storageman

Re: SSD Caching with read/write

Posted: Fri May 10, 2019 5:39 am
by CommonSenseAl
Well... until I get more clarification on this I'm just going to use the SSD as a read-only cache... it's a bummer... it could be so much better with better write caching support when only one SSD is used.

Re: SSD Caching with read/write

Posted: Sat May 18, 2019 4:01 am
by bokr71
Until reading this thread, I was under the impression that the Write cache was indeed flushed "all the time", at least when the system was idle. That is not the case? Someone must know what the flushing parameters are???

Re: SSD Caching with read/write

Posted: Sat May 18, 2019 4:41 am
by Don
bokr71 wrote: Sat May 18, 2019 4:01 am Until reading this thread, I was under the impression that the Write cache was indeed flushed "all the time", at least when the system was idle. That is not the case? Someone must know what the flushing parameters are???
Yeah someone does. It’s QNAP. Open a ticket and ask them and then report back here.

Re: SSD Caching with read/write

Posted: Sat May 18, 2019 5:25 am
by CommonSenseAl
The "answer" I got from QNAP was:
The SSD write cache flushes to the disk when the RAM is available.

No, there won't be any options or function to flush the cache to the disk. This is all done automatically the NAS.
I am not even sure what that really means so if anyone can get a better answer then please post here!

I am still using my SSD as a read-only cache for now (until I get some answers anyway).

But I did upgrade the RAM on my TS-453mini from 2GB to 8GB... hoping that would help. Cost me a little over $50.

Re: SSD Caching with read/write

Posted: Sat May 18, 2019 7:01 am
by bokr71
Actually that answer does make sense. It basically means that you'll be writing to the SSD cache, and it will stay there until it can be offloaded to RAM, which in turn means it will be written to the data volume ASAP. So the process is; Computer -> SSD Cache -> RAM -> Data Vol.

Of course as you usually have a lot less RAM in your NAS than you possibly do SSD Caching, it can take a bit of time, but time here is seconds.

Re: SSD Caching with read/write

Posted: Sat May 18, 2019 9:07 am
by CommonSenseAl
bokr71 wrote: Sat May 18, 2019 7:01 am Actually that answer does make sense. It basically means that you'll be writing to the SSD cache, and it will stay there until it can be offloaded to RAM, which in turn means it will be written to the data volume ASAP. So the process is; Computer -> SSD Cache -> RAM -> Data Vol.

Of course as you usually have a lot less RAM in your NAS than you possibly do SSD Caching, it can take a bit of time, but time here is seconds.
Interesting... well, when I decided to remove the SSD write cache, it took awhile to remove (turn off) while it seemingly wrote/flushed to disk.... so if it writes ASAP then why did it seem to work for awhile flushing the write cache when I turned it off? My NAS is just for home use and it's not very busy at all so if it was flushing constantly then I would think that turning off the SSD cache would be very quick because no flushing would be needed (since it would have been flushed already).

Re: SSD Caching with read/write

Posted: Sat May 18, 2019 11:02 am
by bokr71
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...