Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E8ABB1337BD3 for ; Thu, 24 Mar 2011 12:15:25 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 58908-01-2 for ; Thu, 24 Mar 2011 15:15:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.peak6.com (smtp.optionshouse.com [38.98.137.6]) by mail.postgresql.org (Postfix) with ESMTP id DCD5B1337C62 for ; Thu, 24 Mar 2011 12:14:05 -0300 (ADT) X-AuditID: 0a64cb1e-b7c55ae000000bfb-80-4d8b5fbb622d Message-ID: <4D8B5FB9.7030704@peak6.com> Date: Thu, 24 Mar 2011 10:14:01 -0500 From: Shaun Thomas Reply-To: sthomas@peak6.com Organization: Peak6 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7) Gecko/20100720 Lightning/1.0b2 Thunderbird/3.1.1 MIME-Version: 1.0 To: Uwe Bartels CC: Stephen Frost , "pgsql-performance@postgresql.org" Subject: Re: maintenance_work_mem + create index References: <20110324141303.GE4116@tamriel.snowman.net> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed content-transfer-encoding: 7bit X-Brightmail-Tracker: AAAAAQAAAZE= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201103/310 X-Sequence-Number: 42989 On 03/24/2011 09:40 AM, Uwe Bartels wrote: > Does anybody know of a solution out of that on Linux? > Or is there a dynamic way to put $PGDATA/base/pgsql_tmp into RAM without > blocking it completely like a ram disk? We put this in our startup script just before starting the actual database: for x in $(find ${PGDATA}/base -mindepth 1 -maxdepth 1 -type d); do nDBNum=${x##*/} sDir=${DBSHM}/${nDBNum} if [ ! -d "$sDir" ]; then su -c "mkdir $sDir" - $PGUSER fi done Where PGDATA, DBSHM, and PGUSER are all set in /etc/sysconfig/postgresql. But DBSHM defaults to /dev/shm/pgsql_tmp on our Linux box. Basically what this does is ensures a directory exists for each of your databases in shared memory. Then all we did was symlink the pgsql_tmp folder to point to those shared-memory directories. Many systems default so that up to half of total RAM can be used this way, so we're not at any risk with 64GB on our main nodes. We already run a custom init.d script anyway because we needed something LSB compatible for Pacemaker. I highly recommend it. :) -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 800 | Chicago IL, 60604 312-676-8870 sthomas@peak6.com ______________________________________________ See http://www.peak6.com/email_disclaimer.php for terms and conditions related to this email