[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Moving /tmp to tmpfs makes it useful

2012/5/26 Clint Byrum:

> 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.

There's a much better solution to that: /proc/sys/vm/laptop_mode and
laptop-mode-tools. If you `echo 1 > /proc/sys/vm/laptop_mode` disk
will spin up only when reading. laptop-mode-tools usually also increase
dirty_*_centisecs allowing to not write cache for minutes. So you get
all the benefits of tmpfs without its problems, like heavy swapping or
size limited by memory. :)

> I doubt most spinning disks will go to sleep in < 30 seconds

Mine spins down in 5 seconds.


Reply to: