Primocache and Windows built in caching service

FAQ, getting help, user experience about PrimoCache
Post Reply
Discgear
Level 1
Level 1
Posts: 2
Joined: Wed Dec 07, 2022 3:17 am

Primocache and Windows built in caching service

Post by Discgear »

Hello,

I'm trying to figure out if Primocache will benefit me when Windows has its own built-in caching service. I have a windows 10 system with 512gb of ram, so windows will try to utilize all of it. From what I can tell Windows' caching service takes priority over Primocache. The statistics on Primocache remain blank for a long time and rarely shows that it caches anything.

So far I was only trying it out with 100gb of L1-Cache, read only. I was hoping of getting some ssds and set up a L2-cache Task for a hard drive group of 48tb. Will the L2-cache configuration show a different result or will Windows caching service always be in front, blocking Primocache from doing anything?

Also is it possible to disable or at least limit what drives windows caching service can cache? I really want to have that persistent L2-Cache that Primocache provides for my large data disks.
SnowReborn
Level 4
Level 4
Posts: 34
Joined: Sun Dec 02, 2012 3:13 am

Re: Primocache and Windows built in caching service

Post by SnowReborn »

Very jealous of your 512gb ram(128g here). From my understanding, Yes, windows caching will take priority over primocache. the primocache support has recommended to keep windows caching on along side with primocache. However, if you want to disable windows caching and purely use primocache, then I would recommend a software called ISLC, it will clear windows built in cache. Primocache will benefit you in a different way than windows built-in caching service. Windows built-in is file based cache, where as primocache is block based, it is much more efficient than windows built-in. One instance is particularly useful is a large continuous file. Say if you have a game level or texture file that is single file being 100GB, however, you only read the first 10Gb of that single 100GB file, windows built-in cache will read the entire 100GB file and cache into your RAM, and kicks it out when it ranout of free space, where as primocache will only cache in what's actually read, the 10GB of the 100GB file, instead of the entire files including the unread blocks. since you are running on server board, I assume the 100GB game file analogy is a bad example. This can also be applied to video files for very big project, or Vm Disk file(yes you can literally cache VM). More over, primocache has much more control over windows-built in cachine, you can manually control which partition to cache, how big the cache size, and the ratio of read / write cache. as well as defer write, which is very huge on SSD write cycle. However, windows built-in caching has one advantage over primo, and that is dynamic allocation. Windows will only use the available RAM you are not assigned to any program and is marked free, but primocache will reserve all of what you assigned at one go, but I heard they might be working on the dynamic allocation for future feature.

#2 windows caching will always priorized over L1 or L2, but it's not very reliable since once you are out of memory, or something kicks your old cache out, you are out of luck; where as primocache won't be affected with memory utilization since it allocates all memory reserved for caching without anyy program to reduce the size. So it will have a very consistent caching experience, you will know as long as your primocache is not full, all your cached programs and files will remain being cached and stay fast; where as windows built-in will not once your mem utilization goes up. Windows built-in will NOT block primocache. It will just be priortized and data will be pulled from windows cache FIRST, if requested data is not in Windows Cache, then it will look from Primocache L1, then L2, then Hard disk.

#3 Yes, try Intelligent standby list cleaner ISLC. It will not limit which drive windows can cache, but it can clear and limit windows cache all together, and you will see the primocache utilization go up dramatically. But leaving it on does not affect primocache at all, since primocache is designed to work with windows built-in. What's being read and cached in windows built-in will also be cached in primo, as far as my experience goes. So if you windows built-in cache was kick out, it should be read from primo's cache. I used to also disable windows built-in cache, for me personally is just to better gauge how primocache performs, but there seems to be really no down side to keep windows caching on. So it's just matter of personal preference.
Discgear
Level 1
Level 1
Posts: 2
Joined: Wed Dec 07, 2022 3:17 am

Re: Primocache and Windows built in caching service

Post by Discgear »

With that program I'm finally able to see some statistics on Primocache. So I at least know Primocache is working on my machine. Though suppressing windows cache instead of disabling it is very inefficient. Maybe I might just have overly large amount of ram available to see any immediate benefit and might take weeks to get there. Even then Primocache will only be useful for that one time when windows cache doesn't have it. I'm going to need to get my system fully up and running to see if I can saturate 512gb of ram. Then and only then Primocache can be useful to me.

If it turns out that I don't need Primocache, I don't know what else I can do with these 905p drives I just got on sale. I already have a 2tb Transcend 220S as a boot drive and to hold my vms.
SnowReborn
Level 4
Level 4
Posts: 34
Joined: Sun Dec 02, 2012 3:13 am

Re: Primocache and Windows built in caching service

Post by SnowReborn »

depending on your work load, 128gb ram is no longer enough for me; and I am sure you will find your use case for primocache, knowing you are running a server board with 512gb ram. The primocache use case for me is very different an irreplaceable by windows cache. I often use it's defer write feature, also it comes with it's risks. 905p is pretty good for caching, compared to generic SSDs like your 2TB Transcend 220S. Since optane is rated much higher write endurance, on top that it has much lower latency, that's where SSDs fall off compared to L1 RAM cache and Optane. Also, FYI, I was just confirmed by support that it is also able to cache page file! you may wonder why would I cache page file if I already have 128gb and your 512gb ram. For me I occasionally still go over 128g, but more importantly, when I do AI or machine learning work, when my 4090's 24GB VRAM is full, it will offload to page file regardless of my RAM, so there are many different ways you will find primo to be super handy and useful; and on the note of supressing vs completely disabling. I don't find it inefficient at all, having it running in the background never slowed me down or consumed too much cpu cycle. On top that, as far as I know, since I was in your shoes, I do not recall a way to completely disabling it unless you heavily modify the OS with very low level kernel stuff.
VTOLfreak
Level 1
Level 1
Posts: 3
Joined: Sat Apr 03, 2021 2:07 pm

Re: Primocache and Windows built in caching service

Post by VTOLfreak »

Windows file caching uses a 256KB granularity:
https://learn.microsoft.com/en-us/windo ... anagement/
Old article that explains it more in depth, the mechanism hasn't really changed since then:
https://www.itprotoday.com/compute-engi ... he-manager
Say if you have a game level or texture file that is single file being 100GB, however, you only read the first 10Gb of that single 100GB file, windows built-in cache will read the entire 100GB file and cache into your RAM
Windows does do read-ahead but not the entire file. The behavior is dynamic and applications can also request do to do read ahead. So if you are seeing stupid behavior like this, the blame is on the application, not the OS.

The biggest machines I used Primocache on had 1,5TB of memory and what worked best was to turn L1 off and let the OS figure it out. Windows also does memory compression and deduplication which allows it to fit even more stuff in memory. Granted it's not as good as zSwap and KSM on linux but Primocache doesn't do any compression and dedup at all.

I did use the L2 cache feature on these large systems and that worked well. We could offload read traffic from the SAN and cache it on local disk. Because it was running inside the VM's, Vmware ESXi could just move the entire VM with the cache disk to another host if needed. If the host machine failed, no worries, it was just cached data and everything is on the SAN. (assuming you didn't use defer-write)
SnowReborn
Level 4
Level 4
Posts: 34
Joined: Sun Dec 02, 2012 3:13 am

Re: Primocache and Windows built in caching service

Post by SnowReborn »

VTOLfreak wrote: Thu Dec 08, 2022 4:53 pm Windows file caching uses a 256KB granularity:
https://learn.microsoft.com/en-us/windo ... anagement/
Old article that explains it more in depth, the mechanism hasn't really changed since then:
https://www.itprotoday.com/compute-engi ... he-manager
Say if you have a game level or texture file that is single file being 100GB, however, you only read the first 10Gb of that single 100GB file, windows built-in cache will read the entire 100GB file and cache into your RAM
Windows does do read-ahead but not the entire file. The behavior is dynamic and applications can also request do to do read ahead. So if you are seeing stupid behavior like this, the blame is on the application, not the OS.

The biggest machines I used Primocache on had 1,5TB of memory and what worked best was to turn L1 off and let the OS figure it out. Windows also does memory compression and deduplication which allows it to fit even more stuff in memory. Granted it's not as good as zSwap and KSM on linux but Primocache doesn't do any compression and dedup at all.

I did use the L2 cache feature on these large systems and that worked well. We could offload read traffic from the SAN and cache it on local disk. Because it was running inside the VM's, Vmware ESXi could just move the entire VM with the cache disk to another host if needed. If the host machine failed, no worries, it was just cached data and everything is on the SAN. (assuming you didn't use defer-write)
That's very interesting. Does this also apply to non-server OS? From my very old testing I was convinced windows default behavior is to read the entire file across many different types of file. If what you mentioned is consistent across different editions of Windows, does that mean If an application requests read-ahead, primocache will also read the entire file? So there would be virtually 0 difference between windows built-in and primocache in terms of read cache? (in your wording it sounded like windows L1 read cache is better) except when mem utilization goes up there is a risk of cache being kicked out. I will find some time to test your theory in a VM perhaps.
Post Reply