Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Use RAM sticks as SATA drives?
34 points by simplotek on March 11, 2023 | hide | past | favorite | 69 comments
Does anyone know if there is any product that's a SATA drive that you can plug RAM sticks to serve as temporary memory? And how does it fare with regards to performance?



I recommend that you consider buying a lot of RAM, and using a RAM drive instead. It should be much faster than any SATA-based device (600MB/sec vs whatever your CPU to RAM bandwidth is).

Linux: https://man7.org/linux/man-pages/man5/tmpfs.5.html

Windows: https://sourceforge.net/projects/imdisk-toolkit/


These types of solutions were usually targeted at enterprise customers who had heavy random read and write workloads that needed to be non-volatile. The disks usually had a battery with enough life to dump the data to persistent storage in the case of a reboot or power outage. For example if you had need to continuously update a bloom filter for some reason.

They have been mostly displaced by enterprise SSD based drives that have high IOPs or big data solutions with transaction logs and distributed reads and writes.


Not many people do this (I do, and have done for many years) because they're too used to unreliable systems. A solid (likely *nix-based) system with a UPS and some sort of a backup/save to non-volatile storage on long power-outage strategy works so well that the risks are well worth living with (on the occasions I've blown it, it's generally been some sudo-related thoughtlessness).

Edit: the one thing I'd like from a ram disk for it to survive a reboot; poking about, most memory contents doesn't change across a reboot but AFAIK no OS has the ability to persist a RAMdisk across a restart.



> 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


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

No one presented such use case in this discussion.


adding ram to a motherboard is not possible without upgrading it, costing far more.


Motherboards have ram slots?

Most have four and I'd say most people have two free.


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.


Op, you didn't outline your assumptions and we're just trying to be helpful.


I don't know about SATA drive or anything recent but there was at least one device by Gigabyte called the i-RAM that let you put DDR1 on a card and boot off it. LTT did a video on it a few years ago:

https://m.youtube.com/watch?v=bYbCYgYZVT8


There was also RamSan

https://www.superssd.com/products/ramsan-400/ https://www.superssd.com/success/ccpgames.html

I/Os Per Second 400,000

Capacity 32-128 GB

Bandwidth 3000 MB per second

There is one "untested" on ebay at $800, 64GB model was $72K when new in 2007. Today comparable drive is something like "Verbatim 256GB Vi3000 PCIe Gen 3.0 X4 NVMe M.2 2280 Internal SSD" $38.89 with free shipping from Amazon.


It's absolutely mind-boggling that a tiny NVME M.2 drive can now easily match this performance.


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.


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.

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, under "Dedicated hardware RAM drives"

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


More like 2014-2015, the Allone Cloud Disk:

https://www.thessdreview.com/daily-news/latest-buzz/allone-c...

... not cheap ...


One off device by a company no longer traceable, with an outlandish price (as one comment pointed - they probably wanted a part of FusionIO pie) but only with a two slots for SO-DIMM? Dead from the start.

If there was a (fulfilled) demand than there would be more devices like this, but... by 2012 the problem of a fast storage was solved by throwing loads of SSDs in some SAN (eg 3PAR 7xxx series) and of course enterprise sector preferred volatility and scalability, of which RAM-drives has none. Same with enthusiast market, WD Raptors[4] for a "fast" low/mid-tier, SSD for the fast tier. Just to be sure I checked when OCZ-VERTEX3, which is still running in T440 as a system drive, was anounced - it was ~Feb 2011. In 120Gb and 240Gb versions.

It took some time to dig up the prices (I don't remember nor the prices nor the amount, heck, a decade ago):

> The price of high-end 2GB DDR3 (double data rate, third generation) DRAM modules declined to US$25 in the first half of November, down 46 percent from its peak of US$46.50 in the first half of this year, according to DRAMeXchange. [0] Nov 2010

> G-Skill is offering a value DDR3 kit for $36 USD and Crucial sells their own value RAM for $34.99 over at Newegg. Considering a bit more than 3 years ago (Aprill 22, 2008 via the Way Back Machine’s snapshot of Newegg), a 4GB (2x2GB) kit of G-Skill DDR3 RAM went for $279.99, or about $560 for an equivalent amount of RAM today (8 GB 2×4 GB for $36 versus two 4 GB 2×2 GB kits for $560)! [1] Nov 2011

So even if you were somehow a visionary and would see the price drop a year or two before (ie ~2009)... at 2011 a single 8Gb stick was ~$50, so with $250 you could only get 32Gb (IF the RAM drive card was $50! and it wans't!), compared to $250 for 120Gb of Vertex 3. [2]

Strange visionary who would see a DDR3 price drop, but not SSDs. I paid way less than $250 for that drive, because I bought it somewhere in 2012-2013:

> Just ordered a OCZ Vertex 3 120GB after shipping, taxes and Rebate came to $87.00, ... [4] Apr 2012

[0] https://www.computerworld.com/article/2752016/dram-prices-to...

[1] https://pcper.com/2011/11/ddr3-ram-now-at-all-time-low-price...

[2] https://www.storagereview.com/review/ocz-vertex-3-review-240...

[3] https://hardforum.com/threads/ocz-vertex-3-120-any-good-87-n...

[4] it's quite telling what the last models were announced in 2012 and then quietly disappeared a mere year later: https://forums.tomshardware.com/threads/1tb-velociraptors-di...


Ages ago Acard, who're makers of popular SCSI-IDE adapters and controller chips, made a 5.25" half height device that could take up to four DDR2 DIMMs, connected to the host computer using SATA, and had options for a CF card and a battery.

I'd use something like this for heavy disk I/O over an SSD any day. Plus, it lets you use memory that would otherwise likely go to waste.

However, those were expensive back then and haven't gotten any cheaper, nor are there newer devices that I know about that'd take newer DIMM types. That'd be nice, though.


I had (still have somewhere) one of these! Installation of Windows XP took 20 seconds! I was flabbergasted.

Had to very sadly retire it when Windows 10 came along because their disk requirements increased.

Now that I think about it, I should dig it out and load a lightweight Linux on it.

Project for next weekend fixed!


If you have spare PCIe I’d go with an Intel Optane 905P. You can find a used 960GB drive for about $500. They have essentially unlimited write endurance and has latencies closer to RAM than SATA. You’re going to be very dissappointed with both latency and throughout with anything SATA.



What would be the advantage of having a SATA drive with DRAM instead of an SSD ?

The only potential advantage I see would be read and write speed, but aren't SSD's already fast enough to saturate the SATA bus ? Isn't that why NVME offers better performance than SATA ?

What is clear is that for equivalent capacity DRAM is much more expensive than an SSD.

My guess is that if no one is making a product like what you are asking about it's because it offers no real advantage over the much cheaper solution of adding another SSD.


I guess normal RAM has pretty much infinite TBW compared to an SSD?

Some SATA SSDs have a cached mode where data gets put into normal RAM first, and then copied onto the SSD, but it's not really useful other than getting overinflated benchmarking numbers (things get messy if your system loses power before the data can transfer from RAM to the disk). Samsung calls it RAPID, the Crucial name is Momentum Cache


Some of the enterprise grade SATA SSD's have a fairly long lifespan which might be suitable. eg:

https://www.scorptec.com.au/product/hard-drives-&-ssds/solid...

That's a SATA drive rated for 5,600 TBW, and it's "maximum" rated write speed is 540MB/s.

To work out how long the drive should last at that maximum speed, let's do:

    540MB/s * 60 (seconds) * 60 (minutes) = 1,9444,000 MB per hour
Let's call it 2 TB per hour for simplicity.

We take the rated endurance of 5,600 TBW, and divide it by the above 2 TB/h, giving us "2,800" hours worth of write endurance.

At 24 hours in a day, that's 116 2/3 days worth of endurance at the maximum write speed the whole time.

Anyway, if the project in mind is going to run for less than ~120 days, it should be ok. Any other hardware/software issues aside that is.


Yeah, but with the difference in price you'd have to need to replace your SSD monthly for DRAM to come out cheaper and I highly doubt you'd be writing data that fast.


You can get ECC DDR3 ram for less than $1 per GB, and it doesn't wear out like SSDs do. Makes a lot of sense for a cheap cache disk. I can totally see using a ram disc like that for a zfs/bcachefs cache with a modern CPU that doesn't accept DDR3. Might make more sense to use PCI than SATA though.

A niche market, but I think there would be a market for ram drives like that, especially if they supported ECC memory. Lots of old server memory kicking around but if you want to actually use it your stuck with some abysmal CPU performance and a very high CPU power draw.


$1 per GB is $1000 per TB. I just bought a 1TB SSD for about $70. With such a large price difference you'd be better off buying a new SSD every year or more often, if you're worried about it wearing out.


At that price it's probably QLC, which will be too slow for a busy cache and will probably die in less than a year.


Nah, SSDs are going down nicely in price. You can get 1TB of TLC for less than $50.


As long as SATA is involved, a DRAM-Drive will not be faster than any decent SSD. For the SSD era, SATA is SLOW! That's why NVMe exists.

However, there reasonable reasons for wanting a DRAM-Drive.


> However, there reasonable reasons for wanting a DRAM-Drive.

What would those be ?


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.


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?


It would be a bad idea today to use RAM as a SATA drive. NVMe is much more performant. SAS is available in 12G and 24G. Better would be to utilize DDR3 or better as an NVMe drive or even birfurcated NVMe device. The RAM drive is a good idea too if you have spare RAM or DIMMs. Compressed ZRAM in Linux makes it even better.


if im reading this right, you have extra ram that you dont have dimms for, so youre thinking of interfacing it via sata as a swap. the thing is, ram is much more valuable in a dimm slot, and sata (slow as it is) is much better suited for persistent non volatile storage. so your request is sort of like asking if anyone makes a part for your honda that you can pour jet fuel into but the part will just burn off the excess energy it doesnt need so it drives the same as with regular gas. i would trade the ram for a drive. but purely for fun, you might consider interfacing stuff through as many adapters and interfaces as you can, and make some cool glitch art.


CXL could be used in this way, if you are unfamiliar with the tech., ServeTheHome on YouTube has some good videos detailing it.


I’ve seen drives like the Gigabyte GC-Ramdisk but never used them. But it accepts 4 sticks of ram into a PCIe card.

https://www.newegg.com/amp/gigabyte-gc-ramdisk-others/p/N82E...


Probably not because SSD's pretty much hit the boundaries of the engineering envelope.

The maximum bandwidth of a SATA interface is 6Gb/sec.

For comparison, old PC-1600 DDR RAM has a data rate of 1.6GB/sec...or >10Gb/sec because 1Gb != 1GB.

Over SATA, static RAM is good enough to saturate the interface and is non-volatile and cheaper.

Good luck.


Yes, there's plenty of devices like that, but they're slower than SSDs usually.

The best thing to do would just make a RAMDrive, but x86 systems are surprisingly craptastic with real world memory bandwidth and latency and I haven't found this solution to be mind-blowing.

On ARM it might be a different story.


https://habr.com/en/post/569780/ The way we made an external PCIe RAM disk based on the DDR memory


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.


Modern SSDs far exceed the capabilities of SATA. That is why SSDs now use NVME with M.2 or U.3.

There exist old slow PCI (DDR1 era) cards that do exactly what you expect: https://www.youtube.com/watch?v=bYbCYgYZVT8

There are also some niche contemporary options: https://ddramdisk.store/2022/05/12/meet-the-latest-release/

And in the future there will be very fast options: https://www.anandtech.com/show/16670/using-a-pcie-slot-to-in...


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.


But nvme has lower latency than SATA. A ram disk over SATA just doesn't make sense.


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.


> RAM requires constant power. If you lose power, you lose data (more-or-less instantly).

It's perfectly fine for some uses, mine included.

> I'm going to go out on a limb and say the approach you're considering is practically infeasible.

To each his own, but I know for a fact that hardware RAM drives were indeed sold in the past, and after posting this Ask HN I've stumbled upon companies marketing them.

https://ddramdisk.store/2023/01/19/the-ddr4-pcie-x8-lady-has...


Yep, can definitely make sense for some applications but important to callout explicitly.

Yes! I saw that device from elsewhere in the thread. Wondering when it will be available and what use will look like. Also curious about the battery backup and what maintenance looks like on that.


You would be wrong about SATA being faster than SSD. Which is why fast SSDs use NVMe. Also, SSDs are much larger and cheaper than RAM. 1TB RAM is still expensive, 1TB SSD is $60.

RAM storage has been tried before but was done as PCIe expansion card. It didn’t catch on cause of special drivers, but it only made sense back before NVMe and SSDs were expensive.


> You would be wrong about SATA being faster than SSD.

SATA is the computer bus interface, while SSD is the generic name for a storage device that more often than not comes with SATA interfaces.

SATA was not a hard requirement, just the one that I felt was the most popular.

> Also, SSDs are much larger and cheaper than RAM.

SSDs are not cheaper per GB if you already have RAM sticks lying around. Nevertheless this is besides the point, if the goal is to have low latency temp storage when you already maxed out on RAM.


Unfortunately, NVMe SSD make RAM drives pointless. SSD, and any RAM drive, saturate SATA. NVMe make SSD perform well but won’t work for RAM drive since it is just a card. PCIe works, the old ones used it.

The PCIe RAM drive cards were enterprise and super expensive. You could buy a whole computer for one. It is probably cheaper to sell the RAM sticks and buy SSD. As I mentioned, they are super cheap now and cache would only need small one.

Also, setting up RAM drive is a pain. The old cards required special drivers; new ones could probably emulate NVMe. But setting up cache drive and getting programs to use it for temporary storage is annoying. All SSD is easier. There is a lot of experience with using SSD as durable write cache and not as much using disposable temp space.

For those who need speed, buying more RAM is a better way of doing it. If you really need speed, then new computer with more RAM and NVMe is better approach.

In any case, PCIe RAM drives aren’t made anymore. They were a niche at the time and now there is no market at all.


Why would you do this? A modern ssd outperforms the SATA interface.


There are many plausible reasons for this:

1. Someone already has maxed out their motherboard and has some unused sticks of ram and would like to repurpose them instead of selling them or worse recycling them (remember reuse is before recycle). Reuse as battery powered storage might be an option. (This is the use case of the OP)

2. Someone wants a faux-Optane cache, maybe for the paging file/swap. Maybe to avoid wear on the SSD. Theoretically it should be possible to get higher performance than a SSD (same era RAM is faster than Optane which is faster than same era SSDs), in practice IDK. Maybe Optane is no longer available, or again maybe they already have the RAM

2. Someone wants a Volatile drive, maybe to be used in conjunction with a security oriented Linux distro like QubesOS or Tails. If a switch is tripped, everything on the computer is truly gone.


What are good uses of DDR2 and their ilk? As new DDR gens come and go, there never seems to be any discussion on what to do with the old RAM, which is perfectly good.

Elsewhere in the thread is a mention of gigabyte ramdisk, but what would be really interesting is a second bank you could have on a PCI card that could hold 8 sticks of RAM, and that RAM is considered lower-priority by the OS (use only if the main RAM is getting a bit constrained, or say "use this with the web browser".

But I doubt such features exist even in the Linux kernel.


If you put the swap partition/paging file on the RAM drive you achieve what you suggested. With the benefit of not wearing down an SSD. The better way to do this is with Optane, but Intel abandoned Optane so eventually stocks will run out.


> If a switch is tripped, everything on the computer is truly gone.

Eventually at least. Ram loses its contents slowly, and temperature influences the rate it happens at, hence cold boot attacks where you can super-chill ram with some compressed air, move it out of a secured machine and into one you control, and extract in memory secrets.


1. This really depends on not wanting to sell, because selling and getting a drive is also reuse and puts money in your pocket.

2. Optane is available though, for less than a dollar per gigabyte. And if you have RAM already, you can sell it as above.

3. Encrypt it with a random in-memory key.


1. True

2. Intel abandoned Optane, so availability will be spotty

3. Encryption is not always plausibly deniable. And when it isn't, rubber hose cryptanalysis can be applied even if the key is unrecoverable. Data on a RAM drive, if it was turned off and the attacker didn't immediately freeze it (harder when they don't even know you use a RAM drive, and the case may be hard to open) should be obvious it is gone for any attacker who knows how RAM works. The point is less to protect the data and more to protect the owner from coercion through violence.


You think a RAM disk without backups is plausibly deniable?

And a rubber hose can be applied to "give me the backups" no matter what you do, so I don't know how convincing that is. And if making a new key is automatic on boot I don't know if the additional risk of them not believing you is that high.


A device that can do this would be more expensive than a ssd the size of any reasonable amount of memory someone would have laying around.

I appreciate the idea as an interesting hacker experiment but it has no practical value.


Old hardware device with non upgradable memory and only a SATA interface? Like old game consoles.

I have something myself that is in the ballpark. It's e-ink Thinkpad that has 4GB of soldered memory. It would be plenty fast if only it had more memory. They don't make a newer e-ink laptop like this. It's not SATA but if there was a way to stick a 32GB DDR4 memory stick onto an NVME drive, use it in the second slot as a pure swapfile, that would be a cool little trick to extend the lifespan of this thing.

I might try this with Optane if the prices come down more.


Epyc Embedded (512GB) and Xeon-D (384GB) can be used for "desktop" systems that need lots of RAM.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: