/tmp on tmpfs

Przemek Klosowski przemek.klosowski at nist.gov
Mon Apr 2 22:34:59 UTC 2012


On Mon, Apr 02, 2012 at 08:32:56PM +0200, Miloslav Trmač wrote:
> * #834 F18 Feature: /tmp on tmpfs -
>    http://fedoraproject.org/wiki/Features/tmp-on-tmpfs  (mitr, 17:40:06)
>    * AGREED: tmp-on-tmpfs is accepted (+5 -3)  (mitr, 18:12:52)

The wiki page says:
   By implementing this we, by default, generate less IO on disks. This
   increases SSD lifetime, saves a bit of power and makes things a bit
   faster.

What about the memory pressure? with on-disk /tmp, the buffer cache 
prevents excessive writing if there's memory to spare, but the system 
still works when memory is used up. What happens with tmpfs? I think it 
will just grab and hold memory required for the /tmp filesystem, which 
is likely to cause swapping, which will hammer the disks even more. The 
lack of quota makes it potentially even worse.

Perhaps this should be a default only for systems with ample memory. 
Could it be a startup-time setting that is flipped back to on-disk /tmp 
if some sustained memory exhaustion is detected?

BTW, I thought that the buffer cache makes the speed argument mostly moot.



More information about the devel mailing list