Now Reading
Ask HN: Use RAM sticks as SATA drives

Ask HN: Use RAM sticks as SATA drives

2023-03-11 09:48:49

I did this a decade ago when ram density wasn’t great and memory channels were limiting. Since then, the performance gap between actual ram and anything over sata has only widened. These days, ram density is much better and you also have persistent memory technologies like Intel Apache Pass that give you so much more density on DDR4 channels with latency tradeoff.

> how does it fare with regards to performance?

What’s your use case?

> I recommend that you consider buying a lot of RAM, and using a RAM drive instead.

That suggestion makes no sense. It’s one thing to buy a SSD/PCI interface that allows you to plug in your RAM sticks. It’s an entirely different thing to buy a brand new computer.

Your suggestion is like “do you need more disk space? Just buy a new computer.”

Why would you need to buy a new computer, if you just need more RAM?

..unless, of course – you are blessed with one of the devices that have RAM soldered on. I cannot express how much I dislike these devices.

1. Because you’ve already maxed out your DIMM slots

2. For the cost of upgrading to larger RAM is prohibitive because you have to throw away your existing DIMMs and replace them with new-to-market DIMMs that are extortionate because they’ve only just appeared

The suggestion was probably to put more ram in the computer you already have.

To answer your question though, devices like that have been made from time to time, but I don’t think I’ve seen one since DDR2. It really would be easier to increase your system ram and run a software ram drive.

If you’re already maxed out on ram, you would need to get a new system with more ram slots or higher capacity per slot, etc of course. If you get some off-lease server hardware, you can get tons of slots though.

If you’re wanting to do something with old ram sitting around, you should probably find a marketplace to sell it. Or plan to hoard it until it’s retro.

?!

You don’t have to buy a whole new computer to add RAM to it, unless you’re already hitting the limits of the motherboard, either slots or total capacity. And if you are, you should be able to get away with getting a new motherboard instead of a whole new computer.

> You don’t have to buy a whole new computer to add RAM to it, unless you’re already hitting the limits of the motherboard

Right.

Do you think that anyone interested in using RAM drives and willing to spend money on hardware wouldn’t have already considered using freely available software RAM drive?

If my time on the internet have thought me anything, it is to not assume anything when people ask questions. Countless of times when people complain about their GPU is not working, it’s because they didn’t change the display cable from directly to the motherboard into the GPU itself.

Maybe author is not super into “build a PC” movement, but know they need more RAM, so they ask the question that makes sense to them. I don’t know, and I won’t assume either, so asking basic questions first makes sense.

Maybe they weren’t aware you could create arbitrary memory space on hard-drives via swap, so questions around that would be appropriate as well.

I think I had something similar, back in the DDR1 days. Mine was in a 5.25″ format about the size of a CD-ROM. It was able to get closer to the SATA bandwidth max than anything I could afford with a RAID array of 10k drives. The IOPS were amazing, at the time. Had a battery backup and would cache to conventional disk. Was great for some DB operations…. with the understanding that it was not ECC ram and was a bit volitional. Main issue was the capacity. SSDs that came onto the market were a match for speed and PCIe drives crushed those I/O speeds again, without all the hassle.

PCIE RAM that looks like a disk would be useful for running Llama and other but models, on systems that cap out at 128 GB max. Using FlexGen or other disk offloading… Interesting idea.

Idea of using RAM as a block storage died when $/GB and $/IOPS dropped (with DDR3 and SSD). As you can see nobody bothered with them since 2010[0]

> Also, I presume that a SATA interface to store data in RAM might have better performance than the average SSD.

That totally depends on the silicon capabilities and still would be limited by the SATA. Sure, you would have a very low latency on a random IO, but anything with serious throughput (especially if the block size is small) would quickly saturate the bus. You can see it comparing SATA and NVMe drives from the same vendor and model range.

And a personal anecdote – couple of years ago I did played with a software RAM drive (guess I needed something with tons of IO on a moderate sized load?) and the performance was… not good. Sure, it was a software written by some enthusiast and probably wasn’t optimized, but still.

See Also

Modern SSDs are around $100-150 per TB, so you would get a better size and performance just buying an NVMe drive, with something like M.2 to PCI-E adapter[1] if needed.

PS of course you can just buy an old server mobo and fill it out with your RAM sticks, make a software RAM drive and expose it over Ethernet with iSCSI or FCoE… but again that wouldn’t be cheaper than $100-150 NVMe drive.

[0] https://en.wikipedia.org/wiki/RAM_drive, beneath “Devoted {hardware} RAM drives”

[1] https://www.amazon.com/s?k=m.2+PCIe+converter+card

I’m not sure if one exists, but I think running it over SATA would defeat the purpose of using a RAM disk in the first place. Can I ask why you wouldn’t use a SATA SSD instead?

I have RAM sticks already lying around, so the cost per GB in this scenerio would be zero. Also, I presume that a SATA interface to store data in RAM might have better performance than the average SSD.

RAM requires constant power. If you lose power, you lose data (more-or-less instantly). Not only would you need some kind of controller device to present the RAM as storage to the OS (abstracted NVMe, SATA, something), you would need to figure out how to supply absolutely consistent 100% power to the RAM modules. Such a device would need it’s own battery, capacitor, something to continually power the RAM modules. This isn’t without precedence – many hardware RAID/storage controllers have aggressive battery-backed caching to persist cache data in the event of power failure.

I’m going to go out on a limb and say the approach you’re considering is practically infeasible OR (best case) would need an oddball/bespoke device to pull this off. I’m not aware of such a device.

Closest you could get is using tmpfs or similar on RAM in RAM slots but it kind of sounds like your existing RAM is electrically/physically incompatible with the system you’re attempting this approach with.

It would depend on the controller. Most SATA SSDs are already saturating the max throughput of the interface (~600mb/s iirc), so you might want to look for a PCI-based option instead. Even still, I have a hard time imagining the performance squaring up against a proper NVMe drive.

I’m not trying to discourage you or anything, but I think paying $50 for an adapter to run 500gb of RAM slower than a $50 500gb NVMe drive is a bit of a goose chase. Good luck in your search regardless!

Transfer speed is not everything, latency for random access is one important factor and also performance with randomly accessing many small files… Something even nvme drives are not that fast with…

True! All of that would still depend on the way the memory is being accessed though, and if you really want to maximize the speed at-hand then you’d need a powerful memory controller. Once we get to this stage in the thought-experiment though, I think it makes more sense to install the RAM into a normal system and use a RAM disk to store things in it.

It’s an interesting question, but I think the circumstances explain why nobody has really commercialized something like this. NVMe will get you 90% of the way for 30% of the price, and it’s non-volatile to boot.

Source Link

What's Your Reaction?
Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top