RAM Cache and what it can do for you

Hello everybody, I wanted to share my experience with RAM Caching and to give people more of an understanding on what it is and what it does for your Computer.

First off I need to explain a little about what RAM Caching actually is. A true RAM cache is a software selected area of your system's RAM that is set aside and can only be used by that program as a means of reading and writing data to an SSD or HDD. The larger area of space you give a software program access to makes your RAM Cache more effective with large file transfers. The software utilizes a math algorithm to defer blocks of data before they get written back to the SSD or HDD, then systematically re-writes the data back to the SSD or HDD. This algorithm also has a Cache flush feature. After a certain amount of time has passed (that you are allowed to specify) it will attempt to write all of the remaining deferred blocks to the SSD or HDD, if they are not relevant anymore they are dumped to trim and deleted.

In my experiment I setup my system, a Seagate 2TB Barracuda LP, 16GB Mushkin DDR3 2400 MHz RAM running at 2133 MHz, with a 6144MB RAM Cache. I used a 16KB block size to save on overhead and tested performance using Crystal Disk Mark with a 4000MB Data set and ran 4 iterations of each test. Read and write performance from my OS partition of my RAM Cached 2TB Seagate Barracuda LP (This is a SATA II device):

-----------------------------------------------------------------------

CrystalDiskMark 3.0.2 x64 (C) 2007-2013 hiyohiyo

Crystal Dew World : http://crystalmark.info/

* MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s]

Sequential Read :  3985.087 MB/s

Sequential Write :  4904.185 MB/s

Random Read 512KB :  3853.622 MB/s

Random Write 512KB :  4736.575 MB/s

Random Read 4KB (QD=1) :   599.083 MB/s [146260.6 IOPS]

Random Write 4KB (QD=1) :   329.971 MB/s [ 80559.4 IOPS]

Random Read 4KB (QD=32) :   529.485 MB/s [129268.9 IOPS]

Random Write 4KB (QD=32) :   413.839 MB/s [101034.8 IOPS]

Test : 4000 MB [C: 52.2% (189.2/362.6 GB)] (x4)

Date : 2013/09/16 1:45:25

OS : Windows 7 Home Premium Edition SP1 [6.1 Build 7601] (x64)

 

I would ignore the Sequential reads/writes and Random 512KB reads/writes as those are pure RAM data transfer rates. The interesting part is when you get to Random 4KB reads/writes. These are my control tests with the same data set without a RAM Cache. (This test took 3 times as long as the Cached test)

-----------------------------------------------------------------------

CrystalDiskMark 3.0.2 x64 (C) 2007-2013 hiyohiyo

Crystal Dew World : http://crystalmark.info/

* MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s]

Sequential Read :   124.634 MB/s

Sequential Write :   118.010 MB/s

Random Read 512KB :    32.618 MB/s

Random Write 512KB :    43.258 MB/s

Random Read 4KB (QD=1) :     0.358 MB/s [    87.4 IOPS]

Random Write 4KB (QD=1) :     0.524 MB/s [   128.0 IOPS]

Random Read 4KB (QD=32) :     0.342 MB/s [    83.5 IOPS]

Random Write 4KB (QD=32) :     0.546 MB/s [   133.2 IOPS]

Test : 4000 MB [C: 52.2% (189.2/362.6 GB)] (x4)

Date : 2013/09/16 2:30:16

OS : Windows 7 Home Premium Edition SP1 [6.1 Build 7601] (x64)

Pretty pathetic from a SATA II generation green drive, eh?

Ok, so what does this mean in terms of real world performance? Programs load much faster and web pages within web browsers load faster. Files up to a maximum size of your RAM Cache will transfer between drives at a much faster rate than a normal HDD or SSD can.The downside to RAM Caching, is if you have to transfer file sizes that are extremely large, like 10GB or larger. This will require more RAM in your system to get a large enough RAM Cache so that you don't run into a problem of your Cache filling up with part of the file then having to flush that stored data before it can read more data during a transfer. My personal opinion, is that most users would be ok with 16GB of RAM and a 6GB RAM Cache as most users do not transfer files larger than 6GB that often.

I do not have an SSD to give you performance numbers with a RAM Cache, but I can assure you they eclipse the numbers of my HDD by a steep margin, especially Random 4K reads/writes.

As a precaution I must note, If you wish to have RAM cache accelerated writes, because the data is held in RAM, you run the risk of data corruption if you loose power to the system unless a UPS is implemented.

All tests were done with Crystal Disk Mark v3.0.2 x64 and can be found at this link: http://crystalmark.info/software/CrystalDiskMark/index-e.html

RAM Caching done by PrimoCache Beta v0.9.1 which can be found at this link: http://www.romexsoftware.com/en-us/primo-cache/download.html

 

I need to add an addendum to this thread.

If you want to be able to Cache your OS and any other sensitive data with the writes being held in RAM, I would suggest isolating a small secondary HDD with a partition for keeping daily OS image backups. You can have Windows 7 do a daily overnight backup with an entire OS partition copy to the segregated HDD that has no caching on it. It's not fool proof but it's a lot better to be able to backup your OS and EFI boot partitions that way you at least have somewhere to start back from if you should experience an OS corruption from a power loss during an important data write.

1 Like

I hereby award Batojiri the International Medal of Awesomeness - for acts of computer education above and beyond the call of duty.

This was great. Definently going to try it out once I get my Ivy-e system up and running. 

Has anyone any experience with "ASUS RamDrive" which their ROG Z87 mobo has as a feature?

From what information I know about it, it's not actually a RAM cache but it sets aside a Virtual Drive of your RAM for use of working with files that need speed like Adobe professional programs or installing a single game into that virtual drive for maximum load times.

set this up earlier tonight, i only have 8GB or ram so i gave it 2 (but it seems to be using 4...) i havn't done much so i can't give a full opinion, but for a quick test i loaded up killing floor, from the time i hit play until it started with the logos took about 17 seconds, each time after took about 6 seconds, and if you play games that have a significant ammount of loading (looking at you tf2) i can see how even a small cache could be quite benificial

will update after i've had a bit more use with it

i also set it to read only so i don't run into any issues of loosing files because they were on the ram

That extra 2GB is overhead it needs to run the program with a 4kb block size, try running it with a 16kb block size, it will reduce the overhead by 1.5GB roughly. 2GB overhead with 4kb block size is about how much it costs to Cache a 2TB HDD, the overhead will change in proportion to your HDD or SSD size. So caching a 2TB HDD would be better to use a 16kb block size to balance the overhead/performance costs.

tried that but didn't go down much, then i noticed the "overhead" section, at 16kb it was 200MB, 4kb was 800MB, must have some memory hogs that i just haven't noticed (it's caching a 770GB volume on a 1TB drive)

Okay, how would I set this up?  I don't want to screw anything up.  Some help would be much appreciated.  I have 8GB of DDR3 RAM @ 1866MHz, and I have a 500GB WD Caviar Blue HDD (SATA III).

after it's all installed, click on the "create a new cache disc" icon in top left corner, then check the drives/volumes that you want to be cached (c/ probably, or drive 0), set "os managed memory" to how much ram you want to be used for caching (i used 2gb/ 2048, but it will actually use a bit more as you can see in my post above), set block size (i left it at 4kb, the smaller the better the performance, but the more extra memory it uses, see above post again), set algorithom (alu=cache whatever has been used last, alu-r=cache whatever is used the most), cache stratagy= do you want to speed up reads, writes, or both (i have it set to read only as i don't want to lose anything because it was written to the ram and not the drive), hit start

i think that's everything, it will also work until you tell it to stop, you don't have to launch it every restart

Having it in read only optimization is the safest way to get it working, it only pulls data off the HDD straight to RAM for your OS to read then writes it back at normal HDD speed without holding it in the RAM space. Since you only have 8GB of RAM I would suggest setting a 2GB RAM Cache with a 16kb block size to keep down the overhead requirements. The software is pretty straight forward and pretty much explains itself and what the options do.

Awesome!  Thanks for the info guys.

I just got my 16gb of ram in the mail the other day looks like I will actually have a use for it other then show since I just play games.

Will have to bookmark this.

installed it this morning before leaving for work

I have 32gb's

set it to 12 gig (read / write and deffered)

run passmark and 

fuuuuuuuuu.......

Awesomeness

As a warning, you should do a nightly backup of your entire OS drive on a separate non-cached drive if you want to keep deferred writes cached.

I cannot thank you enough for letting me know about this :D

Awesomeness

awesomeness

No problem but as I said before, keeping a nightly OS backup schedule will be the next best way to insure you don't have a complete OS corruption should you have a power failure with an important OS file being written to the HDD or SSD.

http://www.passmark.com/baselines/V8/display.php?id=13330965031

full passmark score if anyone is interested.

I already have essentials imaged so I dont mind living dangerously :D

I understood little to nothing what was said above, including the numbers, but it seemed like you were talking about using unused ram in your system to speed things up including load times. Would it be possible to preform such black magic with 2x4gb ram? 

It's not black magic its simply computer science. You can run a 2GB RAM Cache with 8GB of system memory but you won't get any good write performance if you happen to transfer files larger than 2GB that often. Best use case for people who have 8GB or less RAM is to improve read performance only, not setup the software for read/write performance.