Is caching an iscsi drive good idea?

FAQ, getting help, user experience about PrimoCache
Post Reply
ianmozzy
Level 3
Level 3
Posts: 15
Joined: Wed Nov 25, 2015 7:23 am

Is caching an iscsi drive good idea?

Post 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
ianmozzy
Level 3
Level 3
Posts: 15
Joined: Wed Nov 25, 2015 7:23 am

Re: Is caching an iscsi drive good idea?

Post 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.
Nick7
Level 5
Level 5
Posts: 46
Joined: Sun Jun 25, 2017 7:50 am

Re: Is caching an iscsi drive good idea?

Post 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.
xinwei
Support Team
Support Team
Posts: 28
Joined: Mon Jan 25, 2021 8:35 am

Re: Is caching an iscsi drive good idea?

Post by xinwei »

Nick7 is right. That's fine if it's read-only
VTOLfreak
Level 1
Level 1
Posts: 3
Joined: Sat Apr 03, 2021 2:07 pm

Re: Is caching an iscsi drive good idea?

Post 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.
User avatar
Jaga
Contributor
Contributor
Posts: 692
Joined: Sat Jan 25, 2014 1:11 am

Re: Is caching an iscsi drive good idea?

Post 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.
Post Reply