Re: Moving /tmp to tmpfs makes it useful
On 05/26/2012 01:33 PM, Clint Byrum wrote:
> On laptops and other power sensitive devices, this is pretty critical.
> Hypothetical: I have 2GB of RAM, and I want to watch a 50MB video file
> on a connection that will take, say, 10 minutes to cache the whole thing
> (and its a 10 minute video).
> With a regular filesystem hosting /tmp, Every 30 seconds I will wake up
> the hard disk, and write data to it. I doubt most spinning disks will
> go to sleep in < 30 seconds, so this is more than 10 minutes solid of
> hard disk spinning.
> With tmpfs, there is no memory pressure, so my disk never even spins up
> to write anything to it. If I do run into memory pressure, yes, I need
> to use swap at that point. But at that point I've got a lot more than
> just the disk draining power.
Now, another hypothetical. Same machine but with 1 GB of RAM (please,
don't tell me that's unusual...), a 600 MB video file, with a video that
hours long. You have Firefox started (to watch the video), and many
pluggins and many tabs open, and it's taking 600 MB of RAM (that's
nothing really unusual, unfortunately). After a while, your HDD starts
spinning like hell, because it's swapping...