PDA

View Full Version : Is a hardware RAM swapdrive feasible?



Konrad
08-24-2010, 07:47 PM
Windows ReadyBoost allows removable drives to be used as swap space to improve system performance. The typical usage model seems to focus on using higher-speed USB flash drives for this purpose.

As much as I hate to let Microsoft decide anything for me, I long ago learned that (as long as I'm running a Windows box) the OS will generally be much happier if I let it configure it's own automated settings for swap allocation.

The USB bus can be fairly crowded, and even top-end chipsets don't approach the theoretical USB2 HighSpeed 480Mbps limit (for example, Intel X58 only supports up to 180Mbps total bidirectional USB bandwidth, probably less in real mobo implementations). Still, real performance can be faster than most SATA and many SSD drives. I don't know what impact SuperSpeed USB3 will have, since I've never actually used it. Yes, I've seen SuperSpeed USB Flash drives, but like their HighSpeed predecessors they advertise that spec to announce compatibility with the USB standard, not actual benchmarked or theoretical performance.

My idea is to use a HighSpeed USB controller and banks of RAM instead of NVFlash ... the logic being that RAM read/write access is generally on the order of < ~5-10ns, while flash is > ~35-60ns read and > ~100-150ns write. Assuming the drive-controller doesn't bottleneck things too badly, a "USB RAM Drive" should theoretically be much faster than a USB Flash Drive. It also doesn't have limited write-cycles before failure. It's even a great way for the paranoid to permanently destroy their cache and temp files.

Implementing this sort of thing isn't much of a problem for me. I've never worked with the Arduino parts popular on this board, but I'm confident parts like an ARM7 or even a Parallax Propeller (which I can use) will easily exceed the capabilities of the CPLD controllers used in consumer flash drives. Sure, RAM costs more than Flash, but in this instance I just happen to have piles of old SDRAM and DDR1/DDR2 (along with spare mobo sockets...) which aren't worth anything anyways.

Of course this wouldn't be a casual project, it would take time and effort. Before I invest that effort, I'd like to hear feedback for this idea.

Is it worth the effort? Will I see any real performance gains over using a standard fixed/removable drive?

nevermind1534
08-24-2010, 09:03 PM
There was a SATA or PCIe RAM drive that I've seen somewhere, but I don't have the link anymore. It might have been linked to from this forum.

x88x
08-24-2010, 09:23 PM
Sounds like a really cool project, especially if you transition it over to USB3.0 when controller chips become more readily available.

That being said, however, you use-case is flawed. Readyboost acts as a third kind of disk cache for the OS, sitting in between the HDD and RAM. Since NAND flash has a much faster random access speed than platter HDDs, it is much faster to cache needed data there than on the disk. However, the problem in this case arises when you look closer at why data is actually put there in the first place.

The OS wants to access data as fast as possible, so to that end it arranges data that is being used or is expected to be used soon (ie, Superfetch) in one of three places (assuming Readyboost is in use): RAM, Readyboost, and HDD. The OS starts filling the fastest medium first, and gradually works its way down.

My point here is that by simply increasing the amount of system RAM available to the OS decreases the need for either of these other caches. In normal use, 4GB+ should remove any need for any cache outside of RAM, and even for heavy use, 8GB+ should be plenty.

If you still want to increase your available Readyboost capacity, Windows 7 (I'm not sure about Vista) can use any drive for Readyboost, so you can hook up a SATA SSD to use with it instead of a USB drive. ..of course, if you are using an SSD in that manner, you are probably already running your OS off an SSD, in which case Readyboost is disabled anyways.

Konrad
08-24-2010, 09:59 PM
Ouch, ReadyBoost is just another sloppy workaround to hide Windows deficiencies.
I'd assumed it was just the "friendly" name for removable drive swap file ... your explanation makes it seem good ol' Microsoft managed to trademark yet another new overcomplicated underefficient way to do things.

True of course, you can always max out RAM. You can even move swap onto a separate drive on a separate interface (controller, channel, bus, whatever). But the amazing thing with Windows is that it'll instantly bloat out and consume whatever hardware you've got, so it'll still want a huge swapfile no matter what you do. (This Tom's Hardware link (http://www.tomshardware.com/reviews/vista-workshop,1775.html) demonstrates that if you disable swap, you'll need a minimum of 8GB physical RAM to open Notepad in Vista without thrash delays.)

So my logic is that as long as I'm running Windows, faster swap is better.
It's really lame that dedicated hardware mods are needed to overcome bad OS, when you think about it.

So ... configuring a USB device as "fixed media" isn't an issue (can be done with any decent U3 configuration or umptool). Taking ReadyBoost entirely out of the equation, I'm basically just thinking of a fixed RAM drive (USB ATA Mass Storage) for all file caches, swap space, etc.

Would this even be worth the effort, given the availability of performance SSDs?

SXRguyinMA
08-24-2010, 11:38 PM
actually if you've got a 1GB stick or two of DDR1 RAM it'd be useful to me :D if you wanna sell it PM me :D

x88x
08-24-2010, 11:47 PM
My 2c, over a USB2.0 interface...no. Over a USB3.0 or SATA interface, probably. Over a PCIe interface? ...HELLS YEAH! Once PCIe 3.0 hits, we could get 16 GB/s of bandwidth with a 16 lane device. Even just a 1 lane device would beat SATA III. Heck, even with PCIe 2.0 we could beat SATA III with a 4 lane device!

Oneslowz28
08-25-2010, 05:24 AM
I have USB 3.0, I need to find a USB 3.0 thumbdrive and check RB out, but I already rock 8gb of ram so I doubt I will see an increase.

OvRiDe
08-25-2010, 06:11 AM
There were some test done when RB first was introduced, and the verdict was that RB is really only effective if you are running less then 2GB of RAM.

Konrad
08-25-2010, 08:50 AM
Hmmm, good feedback. Thanks guys.

x88x
08-25-2010, 02:22 PM
I forget if you're running an SSD or not CJ, but if you are, Windows 7 actually automatically disables Readyboost because your SSD will be faster than any USB drive, even USB3.0.

Luke122
08-25-2010, 03:37 PM
http://benchmarkreviews.com/index.php?option=com_content&task=view&id=308&Itemid=60

BOOM

x88x
08-25-2010, 03:53 PM
Interesting, I hadn't seen a sub-$1,000 product like that since the iRAM-drive. Nowhere near the speeds I would have expected though. I would be willing to bet their bottlenecks are the controller chip and the SATAII interface. All the more reason to go with a PCIe interface. :D

Konrad
08-25-2010, 04:11 PM
That product is very interesting, and only a few bucks more to purchase than to build. I might actually buy it, though I won't be buying any CF cards to go with it.

Luke122
08-25-2010, 04:51 PM
I actually helped assemble a server using one of those devices about a year ago. We loaded it up with 32gb of ram, and sent it out to test. The client needed HUGE I/O capabilities for an accounting database.

I havent heard anything back since then, but then again I'm no longer with that company.. I'll see if I can find out what happened with it.. if anything.