Thursday, March 21, 2013

Making it fast with ramdisks

Let's start. I love Ramdisks and Ramdisk Accessories.

So, here we are, on the computer. Lets say, you have a crazy system, i7, fast hard drive (or even for moar speed, SSD), 16 to 64GB of ram, and you're like "how do I make this thing faster"



Well you have several options. You could try preloading stuff (windows superfetch, linux preload daemon), you could reduce the number of active processes for a whole 0.1% performance boost, or you could get MOAR FASTER.

This is a trick to go at, if you have more than 8GB of ram, and have already relatively optimized your system (defragged, cleaned out, updated, etc).

Ramdisks are great, but which one should I use? If you're on windows, you have tons of options. If you're on linux, I'd use tmpFS, and rsync.

Well, if you check this lovely link you will see the *fastest* ramdisks

Fastests doesn't always mean best though... or does it!?!

Well I put it to the test, and tried several types of Ramdisk Software. Dataram Ramdisk is by far the most popular, and most definitely not the one I recommend. It has serious problems.

Turns out, surprisingly, Soft Perfect Ramdisk despite it's really shitty site, is both the highest quality, and the fastest.

What's so great about it? Images.

Yeah, sure, lots of ramdisks can load from images, and save back to them, if you tell it to save, but what does soft-perfect do special?

Differential block writeback.

So right now, you're like "uhm, dafuq? What the carp is that?"

Quick explanation of how it works. You check 2 boxes. Bam.

Any piece of data that gets written to ramdisk, the "block" that the file is in gets flagged. Once per interval (default is 1 minute), and on shut down.

Once per minute sounds like a lot, but it only writes if you were going to write anyways. If you edit the same file on disk 25 times in a minute (a database for example), it only actually does one write operation, so this *reduces* writes to your drive.

One note, if you do use a ramdisk, there is potential for data loss if you do not use a UPS backup

Given that the files will be saved to disk every minute, worst case you may lose one minute of data. Use at your own risk. I highly recommend UPS systems regardless if you ramdisk or not. They protect your hardware.

So, how do we make the computer faster? You linux people are on your own, I'm writing a windows guide here.

Well, you have to decide how you want to use this ramdisk. I have 16GB of ram.

Well 16GB of ram isn't enough to hold a lot of modern games, modern games can take advantage of supercache pretty well anyways, so it's irrelevant.

Initially I tried a 1GB ramdisk, that filled up fast, 2GB filled too fast, 4 GB seems about right.

If you have 4 x 8GB ramsticks (which sounds crazy expensive but currently is costing ~ 200) then I'd suggest creating to 2 ram disk. Lets call this method #1.

You have two good options
One 4GB, and one 18GB, or one 2GB and one 18GB.

If you want to move windows %tmp% and %temp% environmental variables, which will make things like installing software faster, then you want to have the first ramdisk be 4GB. Otherwise, it can be 2GB. The smaller ramdisk will contain browser cache and profile. For those who don't know, %tmp% and %temp% are the locations of windows temporary data, which disk cleanup (or ccleaner) are always wiping out.

The 18GB ramdisk can contain game images. You make look at this and be like "uhh... that's freaking huge"

I have several games that are over 16GB. Guildwars 2 for example.

You create one image per large game, or one image to cover several smaller games. Your load times will be just about instant.

I personally find this method a pain in the ass. It also destroys your bootup time.

I use method #2. Method #2 is good for 16 to 64GB of ram. (You'd have to derp a very long time without shutdown to take advantage of 64GB) It can even be cost effective in laptops

Method #2 is to allow windows 7/8 to do disk caching, on it's own. If you're on XP, you can go to hell, and if you're on vista, this guide probably doesn't apply to you.

Windows disk caching will cache any assets you have touched since your last bootup, prioritizing things that you use frequently.

Problem with that, your individual cache files are numerous, and also not held for a long time. Here's the trick. You ramdisk %temp%, %tmp%, firefox profile, firefox cache, and chrome cache.
From microsoft site:

To change the location of the System Temp folder, follow the steps given below.

1.       Right click on Computer and click on Properties. In the resulting window with the basic information about your computer

2.       Click on Advanced system settings on the left panel resulting in a dialog box click on the Advanced tab a

3.       Click on the button near the bottom labeled Environment Variables.

4.       You may see both TMP and TEMP listed in the section labeled User variables for (account). That's the common location; each different login account is assigned its own temporary location.

5.       In the Variable value Edit box you may specify the path to the directory that Windows and many other programs will use for temporary files.

Be sure and repeat that process for both %TMP% and %TEMP%.

You'll need to restart any running programs for the new value to take effect. In fact, you'll need to restart Windows for it to begin using the new value for its own temporary files.

How to move Firefox Profile

Firefox profile contains firefox cache, and your sql databases. You *can* move the cache independantly, but it's not necessary.

Create a firefox shortcut, and set it's target in properties to it's current target with -profilemanager after it.

You can create a new profile, or move your current one. I personally think it's a good idea to start fresh with this. Create a new profile

Here you find the official guide to do that.

How to move Chrome Data

Create a shortcut that you intend on using, and change it's target to C:\path-to-chrome-executable\chrome.exe --user-data-dir=Q:\some-directory-here replacing the directory and path with what's currently being used.

Do that, and zoom, you're computer is fast.

If you're *really* adventurous, you can install firefox on the ramdisk itself! The data stays, so it's great.

So, in this guide, you learned how to move firefox profile, move chrome data, move temp data, and which ramdisks to use.

Enjoy

#ramdisk #ram

No comments:

Post a Comment