/tmp on tmpfs

Matt Zimmerman mdz at canonical.com
Sun Sep 12 12:08:07 CDT 2004


On Sun, Sep 12, 2004 at 05:33:59PM +0800, John wrote:

> It would be a disaster for me. I often create ISOs there because they
> won't be kept for long. I don't have a DVD burner on  yet, but a
> dual-layer burner is on my shopping list.

It didn't take me long to break this habit when I started to use tmpfs on
/tmp.  I just use a different directory which is stored on disk.

Of course, if you really hate it, it's a one-character change to /etc/fstab
to disable.

> A problem I've had on 2.2 and 2.4 (I've not put 2.6 to the test yet) is
> having my GUI paged out to swap when I copy large files (or lots of
> files). The files get cached at the expense of the GUI and performance
> falls off for a while after the copy's done.

The virtual memory subsystem in 2.6 is quite different; it may or may not
improve on this particular case, but overall it seems to perform better in
most situations.

> Using tmpfs would make this worse.

Only if you store large files there.  Generally, the files written to /tmp
by programs are quite small[0], and the overhead of writing them out to a
disk-based filesystem is high, while storing them in tmpfs in cheap and
doesn't really create any contention for memory.

-- 
 - mdz

[0] a notable exception would be sort(1), but for best performance, you want
to keep those in memory if at all possible




More information about the sounder mailing list