Received: from maia.hub.org (maia-4.hub.org [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D599363245D for ; Tue, 27 Apr 2010 01:00:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 55426-09 for ; Tue, 27 Apr 2010 03:59:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qy0-f196.google.com (mail-qy0-f196.google.com [209.85.221.196]) by mail.postgresql.org (Postfix) with ESMTP id 5D860632444 for ; Tue, 27 Apr 2010 00:59:51 -0300 (ADT) Received: by qyk34 with SMTP id 34so2006826qyk.10 for ; Mon, 26 Apr 2010 20:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=KxpMjSsRGzP7SsnctkFfafg0hV1/++aNCmBjI5Df9v8=; b=WhsKCFBQc9L/xtfWQi1cT+rrtCZSdDYkhdyst4S7s/fNZbZLXR5fn078eDDvgpJiN6 VZYL8t81KlCqpfIwMv2lihP8G4j1Q7F/6/LI5Rgr0pCwakS3c5NAhNl/xFnCpA4TYVSC ApZpgzvHxHmjwIN3/7y9KzDZcF9xlyBDbi2zk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=H/xrduy8t15mYzdeJF0BfvibiC5xmMCi8u8m4I3rSj9LdSVC3BI8uWcSbUMtZuAUO/ +1KyIrIhUu+SMJed9Aq4QQu8GSzoTcUq9BG18sLZOQpyVhK/tw/UF6zIdl2braKyiwb/ pKvzOmV9w0CmgBWZIRb4ChlR6VSjN4+xZ8/hc= MIME-Version: 1.0 Received: by 10.229.221.84 with SMTP id ib20mr6082879qcb.93.1272340790534; Mon, 26 Apr 2010 20:59:50 -0700 (PDT) Received: by 10.229.12.136 with HTTP; Mon, 26 Apr 2010 20:59:50 -0700 (PDT) In-Reply-To: References: Date: Mon, 26 Apr 2010 21:59:50 -0600 Message-ID: Subject: Re: tmpfs and postgres memory From: Greg Spiegelberg To: Anj Adu Cc: pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201004/321 X-Sequence-Number: 38571 On Mon, Apr 26, 2010 at 5:24 PM, Anj Adu wrote: > I have a 16G box and tmpfs is configured to use 8G for tmpfs . > > Is a lot of memory being wasted that can be used for Postgres ? (I am > not seeing any performance issues, but I am not clear how Linux uses > the tmpfs and how Postgres would be affected by the reduction in > memory) Like Solaris, tmpfs is from swap and swap is both memory and disk so there is no guarantee when you're using it that it will be the fast memory based file system you're looking for. What you may be wanting is ramfs. Unlike tmpfs, it is 100% memory. Another difference is though you may mount a ramfs file system specifying a size, no real size is enforced. If you have 2GB of memory and attempt to copy 2GB of files to a ramfs mount point the system will do it until all the space, i.e. memory, is gone. Both tmpfs and ramfs come with a price, that is at the flick of a switch, loss of power or other cause that resets or reboots the system all data is lost. That reason doesn't necessarily mean you can't use a memory based file system it just limits it's applications. Personally, I'd find a way to tell PostgreSQL about the memory before toying with tmpfs or ramfs but I'm sure our applications are different. -Greg