Page 1 of 1

Is caching an iscsi drive good idea?

Posted: Mon Mar 29, 2021 12:19 pm
by ianmozzy
Hi all

I am upgrading my storage setup.
I have an older machine with freenas installed and an ISCSI drive for my games backup.

Games are becoming huge, so are soon getting more disks to put in my NAS, install Truenas (the next version).
So setup an appropriate hard drive based iscsi device to access from my main machine.
So run games off an iscsi.
That would be very slow, unless caching.

Oh and a 2500Mb/s connection to the NAS.

So I will have about 8TB for games and 400GB NVME on the windows machine to cache with primocache, likely read only.

This is possible.

Anyone else doing this.
Have you had many problems?

Everything is backed up of course.

Also it is possible to make periodic snapshots of the ISCSI virtual drive.
If I go back to an older one, will primocache detect it and automatically reset the cache?

Thanks

Re: Is caching an iscsi drive good idea?

Posted: Mon Mar 29, 2021 12:27 pm
by ianmozzy
Oh and forgot to mention. If I go back to and old snapshot, will be when running linux.
My 'gaming' machine is dual boot windows/linux.

Re: Is caching an iscsi drive good idea?

Posted: Tue Mar 30, 2021 8:41 am
by Nick7
As long as you do not do any writes (even mount R/W) on other OS, you'll be fine.
Doing any changes on disk, reverting snapshots, etc.. will cause data corruption.

Re: Is caching an iscsi drive good idea?

Posted: Thu Apr 01, 2021 3:42 am
by xinwei
Nick7 is right. That's fine if it's read-only

Re: Is caching an iscsi drive good idea?

Posted: Sat Apr 03, 2021 2:14 pm
by VTOLfreak
I did this for years, 10gbit LAN to a 16TB TrueNAS box. 1TB SSD on my machine set to read-only caching. The only downside is in case of a crash, the cache content gets reset. I've moved the cache SSD into the NAS and set it as L2ARC now that TrueNAS has persistent L2ARC since v12.0. Honestly, I don't notice a difference either way. If your LAN is only 2,5gbit instead of 10gbit, you might notice more of an impact.

Re: Is caching an iscsi drive good idea?

Posted: Sat Apr 03, 2021 6:34 pm
by Jaga
ianmozzy wrote: Mon Mar 29, 2021 12:19 pmAlso it is possible to make periodic snapshots of the ISCSI virtual drive.
If I go back to an older one, will primocache detect it and automatically reset the cache?
As others have eluded to: any writes made to the iSCSI drive while Windows isn't active will invalidate the entire cache. So if you restore an older snapshot (outside of Windows), Primocache's cache contents are invalid and it is emptied at next Windows boot.

I haven't tried Windows/Linux while using Primocache, but if I had a word of advice: don't ever mount the iSCSI drive in Linux after you've started caching it with Primocache under Windows, or you'll lose the cache contents. I believe even the act of mounting/reading a drive in either OS flags it, which Primocache will notice.

Further, if you are caching ~4TB of games with a ~400GB NVMe, you'll have at absolute best, a 10% data coverage. 10% isn't abysmal (I prefer 20% or higher), but neither is it great. You'll want to stick to playing the same few games for a long period of time, or trying to force the iSCSI data into the cache. 7zip can help with this since it comes with a context menu entry for files/folders that can hash check the data, effectively forcing a read on it (and pushing it into Primocache as a result).

You'll obviously have the best results running only 1-2 games for an extended period of time, or increasing the size of the L2 drive and manually forcing data into it with CRC checks.