Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Apr 2012 19:54:51 +0000 (UTC)
From:      jb <jb.1234abcd@gmail.com>
To:        freebsd-current@freebsd.org
Subject:   Re: Using TMPFS for /tmp and /var/run?
Message-ID:  <loom.20120401T215036-109@post.gmane.org>
References:  <4F746F1E.6090702@mail.zedat.fu-berlin.de> <4F74BCE8.2030802@vangyzen.net> <CACM2%2B-7Ahn6J=CTASe0g48%2BSD2vvLVd_hG3DRZmvO31QszG5Xw@mail.gmail.com> <20120330.151848.41706133.sthaug@nethelp.no> <CADGWnjXj5W_UCHPExNjxHgq3EZHP1GwocnK4kOHLch5y3gNG0A@mail.gmail.com> <4F765682.5040707@gmail.com> <20120401134025.GC76647@in-addr.com> <20120401161504.49003b73@linux-wb36.example.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Rainer Duffner <rainer <at> ultra-secure.de> writes:

> 
> Am Sun, 1 Apr 2012 09:40:25 -0400
> schrieb Gary Palmer <gpalmer <at> freebsd.org>:
> 
> > Other than catching software that mistakenly assumes /tmp
> > and/or /var/run is persistent, what are the CLEAR advantages for
> > changing the default?
> 
> It's my understanding it improves performance in cases where lots of
> files are created and deleted in /tmp (and/or /var/tmp - sometimes
> software hard-codes these locations...).
> ...
> OTOH, on new installs, a TMPFS could be used automatically if memory >=
> 4GB.
> ...

There are memory management subsystem considerations against utilizing
tmpfs (memory + swap) for /tmp:
- only part of the program needs to be in the memory for execution
  Delayed and hidden demand for memory.
- demand paging
  Bring a page from swap into memory only when it is needed.
  Delayed and hidden demand for memory.
- Copy-on-Write
  Initial sharing of memory by processes.
  Delayed and hidden demand for memory.
- thrashing
  Excessive in/out swap utilization.
  Very high page-fault rate -> low CPU utilization -> OS thinks it can schedule 
  more tasks -> another process added for execution
- memory overcommit
  Physical memory overcommit resulting in paging; swap space pre-reservation
  Due to it, on heavy loaded systems processes dying on memory pressure.
- Out-of-Memory (OOM) killer
  Due to it, on heavy loaded systems processes dying on memory pressure.

There is a potential for overlapping and multiplying effects from the above and
possibly other factors.

If somebody wants it, despite all dangers to efficiency and stability of their
system, let them make that choice. After all, what real pros are known for is
that they know why and how to customize their systems for a task.

To offer it as a default setup is not called for, regardless of memory plus
swap sizes.

jb





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?loom.20120401T215036-109>