From owner-freebsd-questions@FreeBSD.ORG Tue Oct 20 15:20:50 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B63810656B3 for ; Tue, 20 Oct 2009 15:20:50 +0000 (UTC) (envelope-from chris@vindaloo.com) Received: from corellia.vindaloo.com (corellia.vindaloo.com [64.51.148.100]) by mx1.freebsd.org (Postfix) with ESMTP id 2B9CF8FC17 for ; Tue, 20 Oct 2009 15:20:49 +0000 (UTC) Received: from bespin.vindaloo.com (bespin.vindaloo.com [172.24.145.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by corellia.vindaloo.com (Postfix) with ESMTP id 535705CF0; Tue, 20 Oct 2009 11:20:49 -0400 (EDT) From: Christopher Hilton Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Date: Tue, 20 Oct 2009 11:20:38 -0400 To: freebsd-questions@freebsd.org Message-Id: <9B5D4ADA-E163-4AC5-B293-7C5FA7CE0DA5@vindaloo.com> Mime-Version: 1.0 (Apple Message framework v1076) X-Mailer: Apple Mail (2.1076) Subject: /tmp on mfs X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 15:20:50 -0000 Reading the list yesterday I came across a little controversy about swap backed /tmp filesystems. I've been using this in my /etc/rc.conf tmpmfs="YES" # Set to YES to always create an mfs /tmp, NO to never tmpsize="1g" # Size of mfs /tmp if created tmpmfs_flags="-S -o async,noexec" # Extra mdmfs options for the mfs /tmp To mount /tmp on a swap backed filesystem. I've been assuming that data stored in the /tmp directory was held in RAM and then written to the swap space only when the system had a more pressing need for the RAM. I typically configure my systems with swap == 2 * RAM or more. And on the systems in question I have at least 1Gb of RAM. I was hoping to use this trick to enhance the performance of the postgresql database (temp_tablespace=/tmp/pgsql/....) Is my assumption about where the data in a temporary file is stored incorrect? -- Chris