Settings

Theme

Create turbocharged storage using tmpfs

kevin.vanzonneveld.net

13 points by seancron 14 years ago · 3 comments

Reader

georgebashi 14 years ago

I've seen this tip a few times before, but have always wondered: isn't this what the OS disk cache should do? One of the "possible uses" is:

What if you're an internet host and you want to show off your massive bandwidth by having users download a dummy .bin file of 100MB. You'll find that if many users access this file at the same time, your hard drive becomes the slow factor and you're running into disk IO problems.

Surely the OS should keep this 100MB around, rather than re-reading it from the disk over and over? By keeping it in tmpfs, aren't you just "locking" the file in RAM, and defeating whatever "optimal" choice the OS is making over what files to keep around? Isn't this something better done by vmtouch? (http://hoytech.com/vmtouch/)

  • wmf 14 years ago

    Yeah, I don't see any reason why tmpfs would be faster than hitting in the page cache (since that's what tmpfs is). Also, AFAIK tmpfs memory is swappable, so it isn't even guaranteed to be in RAM.

Adrock 14 years ago

As was already pointed out, you're often better off relying on the OS disk cache.

One situation that I've had a good use for tmpfs was when watching videos on my non-SSD-equiped laptop on a long flight. I'd copy the video to tmpfs and then force the hard drive to spin down. It had a measurable impact on battery life.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection