Hacker News new | ask | show | jobs
by bryanlarsen 3957 days ago
I still don't understand. If you have tons of RAM, your OS uses it for cache, so disk access is at RAM speed. I only reboot my computer a few times a year, so if I had 256GB of RAM in my computer everything I use at least once a month would be in cache.
1 comments

I doubt very much that this is the case. Your OS can't possibly report to, say, your database, that something is written, if in fact it is still being written. Likewise if your compiler produces a bunch of object files before linking them, your OS won't just stick them in RAM and say "well, there's your file, it's written" while not actually being written. I just don't think it works that way!

If it did, SSD's wouldn't be so much faster than spinning-platter HDD's...

A buffer cache in write-back mode would do this, but DBMSs are usually very strict when it comes to waiting for data to hit long-term storage. Most of the implementations access the disk directly, bypassing such mechanisms in the process.

http://www.tldp.org/LDP/sag/html/buffer-cache.html

right, and this is just one example.
SSDs are still faster for non-cached reads, which are significant, since most people don't have as much RAM as they have of permanent storage.

By the way, what you're proposing in terms of software has been available for a long time; multiple distros (including Ubuntu) can/could be booted completely to RAM, using tmpfs as the filesystem. For example:

At the boot prompt, type "knoppix toram". Knoppix will load the contents of the CD into ram and run from there. After boot up, the CD can be removed and the cd drive will be available for other uses. Because this will take up a lot of ram, it is recommended for those with at least 1 GB of ram.

It's definitively faster, I just don't have the necessary RAM to fit all my system in there.

Not only that, at the first power loss you would lose all your data. I wouldn't boot anything critical straight to RAM! It's just not the kind of guarantees we're used to.

If it were all in a sealed package that 'guarantees' the RAM will never power down, at a very low firmware level, that is a different matter.