From owner-freebsd-current@FreeBSD.ORG Thu Mar 29 16:14:53 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D57E106564A for ; Thu, 29 Mar 2012 16:14:53 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (m209-73.dsl.rawbw.com [198.144.209.73]) by mx1.freebsd.org (Postfix) with ESMTP id CD1DF8FC2A for ; Thu, 29 Mar 2012 16:14:52 +0000 (UTC) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.14.5/8.14.5) with ESMTP id q2TGEquk025076; Thu, 29 Mar 2012 09:14:52 -0700 (PDT) (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.14.5/8.14.5/Submit) id q2TGEqES025075; Thu, 29 Mar 2012 09:14:52 -0700 (PDT) (envelope-from david) Date: Thu, 29 Mar 2012 09:14:52 -0700 From: David Wolfskill To: "O. Hartmann" Message-ID: <20120329161452.GZ1709@albert.catwhisker.org> References: <4F746F1E.6090702@mail.zedat.fu-berlin.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vDpQvD79HZx/5O2q" Content-Disposition: inline In-Reply-To: <4F746F1E.6090702@mail.zedat.fu-berlin.de> User-Agent: Mutt/1.4.2.3i Cc: Current FreeBSD Subject: Re: Using TMPFS for /tmp and /var/run? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2012 16:14:53 -0000 --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--