zero cache hits in games

FAQ, getting help, user experience about PrimoCache
Flyingcircus
Level 2
Level 2
Posts: 8
Joined: Tue Aug 13, 2013 10:36 pm

zero cache hits in games

Post by Flyingcircus »

Hi!

I've been testing PrimoCache for the past couple days and so far it's been working great with a cache hit rate of about 25-30% with a standard desktop workload.
However when i checked out some games i noticed that the cache hit rate is absolute zero with all of them even if i load the same savegame/area/level over and over again..
no hits at all as far as i can tell and if there are any they'd have to be in the kilobytes while the total reads are in the dozens or hundreds of megabytes.
Is there any known reason for that? Or are the hits just not being registered for some reason?

For completenes' sake the games i tested with are Anno 2070, Mechwarrior Online and Lord of the Rings Online.

Thanks in advance
AikenDrum
Level 2
Level 2
Posts: 8
Joined: Thu Aug 15, 2013 2:25 am

Re: zero cache hits in games

Post by AikenDrum »

Seeing the same thing with various different games. In a few cases, I see a hundred Kbytes or two getting read from cache, but mostly nothing. It claims it's got the full amount IN the cache, but doesn't report reading from it.

Is this a side effect of game programmers using FILE_FLAG_UNBUFFERED most of the time? I know that supposedly sidesteps the windows cache, but I'm not sure about Primo.
Incriminated
Level 6
Level 6
Posts: 65
Joined: Fri May 31, 2013 3:03 pm

Re: zero cache hits in games

Post by Incriminated »

1. It only hits when files are read at least a second time.... in other words, when you fail in game and it has to re-load the same stuff again, then there is a chance, but...
2. usually if games have long re-load tasks they mostly read it from ram (cashing in game design), so a new disk read isnt neccesary at all.
3. the raw data of such level/map-information of a game isn't that huge. most time beeing spend on decoding the compressed files (CPU/Mem-Subset).

if you have doubt better try measuring the game-level loading times on a second-try, definetly is faster for me with primo.
Flyingcircus
Level 2
Level 2
Posts: 8
Joined: Tue Aug 13, 2013 10:36 pm

Re: zero cache hits in games

Post by Flyingcircus »

1. Well like i said I tried reloading the same data several times... my cache is 3GB in size, that's bigger than the memory footprint of any of those games so limited cache size shouldn't be the issue i hope (in case of MWO the cache is actually bigger than the game itself... and i already tried starting all of the games with an almost empty cache)
2. As I mentioned plenty of disk reads are recorded by the statistics tool however none of them are cache hits
3. That's true for vertex data however textures and heightmaps are quite big and that's reflected in the several hundreds of MB of disk reads that do happen when loading the games


Differences in level loading times on a second run would be inconclusive because of the facts you mentioned.
The games do make use of the RAM themselves and they can place frequently or recently used files into ram so an increase in loading times on a second run doesn't necessarily have to happen because of (unreported) primocache hits.
And i haven't noticed any significant differences either

It seems to me almost as if PrimoCache doesn't recognize it's being asked to read the same blocks again.

AikenDrum wrote:Seeing the same thing with various different games. In a few cases, I see a hundred Kbytes or two getting read from cache, but mostly nothing. It claims it's got the full amount IN the cache, but doesn't report reading from it.

Is this a side effect of game programmers using FILE_FLAG_UNBUFFERED most of the time? I know that supposedly sidesteps the windows cache, but I'm not sure about Primo.

Maybe i'm wrong but the way i understood it the windows cache works a bit differently than PrimoCache.

The windows cache caches data based on applications.. PrimoCache is "dumb" and only caches data based on blocks without having knowledge about what application it belongs to. So it shouldn't handle game data any different than other data as long as it can identify the blocks.. or somesuch.
Maybe what i just wrote is complete nonsense though :)
AikenDrum
Level 2
Level 2
Posts: 8
Joined: Thu Aug 15, 2013 2:25 am

Re: zero cache hits in games

Post by AikenDrum »

Games may cache internally during a single run, in some cases, but if you exit the game and re-run, it's going to come from disk again (or cache). PrimoCache's own statistics say that game reads are, by and large, not coming from its cache at all in such cases.

It would appear that only the .exe itself is coming from the cache, judging by the tiny hit that does happen. The stats are either incorrect or Primo is not actually providing cached data for such reads.
Flyingcircus
Level 2
Level 2
Posts: 8
Joined: Tue Aug 13, 2013 10:36 pm

Re: zero cache hits in games

Post by Flyingcircus »

AikenDrum wrote:Games may cache internally during a single run, in some cases

yes that's what i meant
with "2nd run" i wasn't referring to the game being restarted but another attempt at loading the same data again
of course once the game is closed anything the game itself may have cached would be gone

i tried restarting the game aswell and had no measurable difference at all (yes i did use a stopwatch)
robertcollier4
Level 3
Level 3
Posts: 17
Joined: Thu Nov 15, 2012 6:35 am

Re: zero cache hits in games

Post by robertcollier4 »

AikenDrum wrote:Is this a side effect of game programmers using FILE_FLAG_UNBUFFERED most of the time? I know that supposedly sidesteps the windows cache, but I'm not sure about Primo.
It could be tested whether things read with FILE_FLAG_NO_BUFFERING flag are still hitting PrimoCache by trying to copy a file repeated times from a PrimoCache drive with FastCopy. FastCopy uses its own internal buffer and requests files from Windows with the FILE_FLAG_NO_BUFFERING.
http://portableapps.com/apps/utilities/ ... y-portable
User avatar
Support
Support Team
Support Team
Posts: 3627
Joined: Sun Dec 21, 2008 2:42 am

Re: zero cache hits in games

Post by Support »

Hi Flyingcircus,

May I know your cache settings? and windows OS? How much physical memory is installed on your computer?
AikenDrum
Level 2
Level 2
Posts: 8
Joined: Thu Aug 15, 2013 2:25 am

Re: zero cache hits in games

Post by AikenDrum »

I'm not FlyingCircus, but since I'm also seeing the problem, I'll also answer:

Win7 Ultimate x64, 32GiB RAM, socket 2011 3770K CPU, with...
  • Primo Cache 1 is on a Windows-software-striped 1024GB volume (game data, very fast):
    • 12288MiB cache
    • 16KiB blocks
    • LFU-R
    • R/W
    • 10s deferred writeback
  • Primo Cache 2 is on the onboard Intel chipset's hardware RAID0 512GB volume (OS and saved games, fast-ish, but reliable):
    • 2048MiB cache
    • 16KiB blocks
    • LFU-R
    • R/O
  • Primo Cache 3 is on a Marvell RAID0 1024GB volume (slow game data, mostly movies, using cheap, big drives):
    • 2048MiB cache
    • 16KiB blocks
    • LFU-R
    • R/W
    • 10s deferred writeback
Basically, I'm using half of the physical memory for caches. Games don't normally use anything close to the other half.

Oh, and I was still seeing the effect even when I only had one cache, so I don't think that's the problem.
Flyingcircus
Level 2
Level 2
Posts: 8
Joined: Tue Aug 13, 2013 10:36 pm

Re: zero cache hits in games

Post by Flyingcircus »

support wrote:Hi Flyingcircus,

May I know your cache settings? and windows OS? How much physical memory is installed on your computer?

Hi

Of course.
Currently i have 16GB (4*4GB) of DDR3 SDRAM installed (1333Mhz with a timing of 7-7-7-21 in case you need that info) and am using Windows 7 pro 64bit.

I'm caching a Samsung SSD 830 128GB with
- block size of 4KB
- LFU-R alg
- 15s write defer (which seems to be working in games)
- total size of exactly 3GB

I also have a 2nd cache on a WD5000AAKS with
- block size of 32KB
- LFU-R alg
- no write defer
- total size of exactly 2 GB

All the games are running off the SSD.

Level 2 cache is disabled on both
Post Reply