Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Mar 2012 09:14:52 -0700
From:      David Wolfskill <david@catwhisker.org>
To:        "O. Hartmann" <ohartman@mail.zedat.fu-berlin.de>
Cc:        Current FreeBSD <freebsd-current@freebsd.org>
Subject:   Re: Using TMPFS for /tmp and /var/run?
Message-ID:  <20120329161452.GZ1709@albert.catwhisker.org>
In-Reply-To: <4F746F1E.6090702@mail.zedat.fu-berlin.de>
References:  <4F746F1E.6090702@mail.zedat.fu-berlin.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--vDpQvD79HZx/5O2q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Mar 29, 2012 at 04:18:06PM +0200, O. Hartmann wrote:
> I was wondering if there are some objections using TMPFS for /tmp and
> /var/run.
> ...
> My question is whether there are objections using TMPFS for bot /tmp/
> and /var/run/ at this stage on FreeBSD 10.0-CURRENT/amd64?
> ....

I have no experience using tmpfs for /var/run, but I have been using it
for /tmp for some time (mostly in i386, though).

While I use it quite successfully on machines with a small number of
folks actively busy -- e.g., my desktop; my laptop; my home machines), I
encountered some issues when I tried to do so on machines that were
intended for significantly "heavier" use.  Specifically:

* Compared to an md-resident /tmp, a tmpfs-resident /tmp has much less
  flexibility for specifying the size.  Per mdconfig(8), the former
  uses:

     -s size
             Size of the memory disk.  Size is the number of 512 byte secto=
rs
             unless suffixed with a b, k, m, g, or t which denotes byte, ki=
lo-
             byte, megabyte, gigabyte and terabyte respectively. Options -a
             and -t swap are implied if not specified.

  while the latter uses:

     size    Specifies the total file system size in bytes.  If zero (the
             default) or a value larger than SIZE_MAX - PAGE_SIZE is given,
             the available amount of memory (including main memory and swap
             space) will be used.

  In this configuration, I would have preferred to have specified
  about 10GB for /tmp.  I wouldn't mind if it spilled to swap space,
  but I certaianly didn't want it using 10GB of RAM -- especially since
  the machines only had 6GB RAM.

  Nor did I especially want *all* of the swap space used for /tmp.  I
  would have allocated (say) 20GB for swap.  I wouldn't mind if half of
  that were used for /tmp -- but a reason I allocate so much swap is
  that I've seen what happens when a machine runs out of swap, and it
  wasn't pretty.


  In any case, effective maximum usable size for tmpfs involves SIZE_MAX
  (~4G) & PAGE_SIZE (4K, in my case).

* Even when I went ahead and created a tmpfs for /tmp, I'd get ENOSPC
  whenever I tried to allocate anything on it -- until I dropped the
  size specification to <2G (2**32).  Well, 2GB for /tmp just wasn't at
  all likely to be useful for my purposes in this case.

So I continue to use tmpfs for /tmp for machines with fewer folks
logging in, but I'm a bit less enthusiastic about its use unless the
workload and other requirements are fairly carefully considered
beforehand.

Peace,
david
--=20
David H. Wolfskill				david@catwhisker.org
Depriving a girl or boy of an opportunity for education is evil.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.

--vDpQvD79HZx/5O2q
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iEYEARECAAYFAk90insACgkQmprOCmdXAD2bigCZAfUCR8ZtiCOq69LtT5y+cNVE
Z78An0ufoNQpmnJ+fcWIgdOsa0YZWYQh
=KARh
-----END PGP SIGNATURE-----

--vDpQvD79HZx/5O2q--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120329161452.GZ1709>