One or Four?

RW rwmaillists at googlemail.com
Sat Feb 18 14:54:40 UTC 2012


On Fri, 17 Feb 2012 16:10:00 -0800
Robison, Dave wrote:

> On 02/17/2012 15:55, Chuck Swiger wrote:
> >
> > Yes.  It works as intended even when /tmp is part of a single root
> > partition; although mounting /tmp as a RAM- or swap-based tmpfs
> > filesystem might be better for many situations.
> 
> Sure it has its uses, but now you're jumping into new territory where 
> the installer has to either ask the user to create tmpfs or make the 
> decision to do it on its own. As has been stated, this is fine if 
> sufficient RAM is available. Personally I don't like using RAM for
> tmp.

The only option for a genuinely ram-backed /tmp is something that you
should probably never use for anything, a malloc-backed md device using
wired kernel memory. If there is a good reason for that I can't think
of it, it keeps all files, even deleted ones, in memory even at the
expense of the processes that are accessing the files.   

The practical choices are tmpfs or (if you don't trust tmpfs) a
swap-backed md device.  Both of these use swap-backed storage via the
normal VM/Caching-system. tmpfs files tend to stay cached longer than
on a normal UFS partition (because there's no deadline for writing out
dirty pages) but that's generally what you want.
 
In my experience /tmpfs works well whether you have too little or too
much memory. I've been using it for building ports for a long time, and
it works fine even on ports that couldn't be built on ufs without swap
usage. 


More information about the freebsd-questions mailing list