/tmp: change default to mdmfs and/or tmpfs?

Warren Block wblock at wonkity.com
Sun Jun 9 13:25:56 UTC 2013


On Sun, 9 Jun 2013, Dmitry Morozovsky wrote:

> Dear colleagues,
>
> what do you think about stop using precious disk or even SSD resources for
> /tmp?
>
> For last several (well, maybe over 10?) years I constantly use md (swap-backed)
> for /tmp, usually 128M in size, which is enough for most of our server needs.
> Some require more, but none more than 512M.  Regarding the options, we use
> tmpmfs_flags="-S -n -o async -b 4096 -f 512"
>
> Given more and more fixes/improvements committed to tmpfs, switching /tmp to it
> would be even better idea.
>
> You thoughts?  Thank you!

tmpfs has been working fine here for /tmp.  I also use it for /usr/obj. 
It does not tie up a fixed chunk of RAM, and can grow to large sizes if 
necessary.  And maximum size can be limited in fstab.  (Possible 
improvement: allow human-readable sizes instead of just blocks.)

One problem is that tmpfs is cleared by a reboot.  This would surprise 
users expecting the default behavior (clear_tmp_enable="NO"), and would 
require some prominent warnings in the release notes and maybe in the 
installer.  Or in the startup scripts: "/tmp on tmpfs, contents will be 
discarded on reboot".


More information about the freebsd-fs mailing list