tmpfs for /tmp
Kees Cook
kees at ubuntu.com
Mon May 14 21:11:59 UTC 2012
On Sat, May 05, 2012 at 01:03:13PM -0700, Martin Pitt wrote:
> Hello Phillip,
>
> Phillip Susi [2012-01-13 15:39 -0500]:
> > Bug #18661 has been requesting that /tmp be mounted as a tmpfs since
> > 2005. Either this should finally be done, or marked as wontfix. I
> > would like the TB to decide if this should be done or not. If not,
> > please mark the bug as wontfix with the rationale, if yes, then it
> > should be as simple as changing the default fstab file in the mountall
> > package from fs type none to tmpfs for /tmp.
>
> Now that precise is out of the door, I think we should revisit this
> question. A tmpfs /tmp/ is much more efficient for the bulk of stuff
> that goes to /tmp than a real hard disk file system, as it avoids
> disk wakeups, unnecessary IO, etc.
>
> The regression potential with that change is that there are programs
> which assume that they have plenty of space in /tmp; e. g. Firefox
> downloads things there, unless you use "Save as..". There might also
> be CD burning programs, video encoders etc. which try to place huge
> files there. So we need to identify those and fix them to put large
> stuff into /var/tmp/ instead.
>
> In practice it doesn't seem to be so bad, though. I've been running
> with a tmpfs /tmp for quite some months now without problems, but then
> again my computer usage habits are fairly regular and presumably much
> different from the average user (e. g. I don't do video editing or
> CD/DVD burning at all).
I did a trial run with a tmpfs /tmp and it worked well for a while,
but at one point ended up pushing my system heavily into swap (while
doing a set of full-archive searches that unpacked into /tmp). I'll be
more careful about that in the future to aim it at /var/tmp.
> I think early quantal would be a great time to enable this, so that we
> have some time to identify problematic programs.
While I generally support the /tmp-tmpfs idea, I think I'd like to see
the default remain non-tmpfs on server installs. The problems I ran into
were arguably "server" tasks, and as such, I think allowing a server to
push itself into swap on heavy /tmp usage is a poor default. The desktop
use-case is different.
-Kees
--
Kees Cook
More information about the technical-board
mailing list