Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 0B7F91337B47 for ; Mon, 2 May 2011 07:50:29 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 04329-08 for ; Mon, 2 May 2011 10:50:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.gransy.com (mail.gransy.com [82.208.29.194]) by mail.postgresql.org (Postfix) with ESMTP id 0F14213364DE for ; Mon, 2 May 2011 07:50:20 -0300 (ADT) Received: from [192.168.1.221] (ip-94-112-0-189.net.upcbroadband.cz [94.112.0.189]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.gransy.com (Postfix) with ESMTPSA id C45BC4A2329 for ; Mon, 2 May 2011 12:50:19 +0200 (CEST) Message-ID: <4DBE8C6B.9070208@fuzzy.cz> Date: Mon, 02 May 2011 12:50:19 +0200 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101219 Lightning/1.0b3pre Thunderbird/3.1.7 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: The right SHMMAX and FILE_MAX References: <4DBE38BB.7040106@orkash.com> In-Reply-To: <4DBE38BB.7040106@orkash.com> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 201105/13 X-Sequence-Number: 43522 Dne 2.5.2011 06:53, Adarsh Sharma napsal(a): > I am also in need of a proper documentation that explains how to set > SHMAX and SHMALL variables in Postgres. > > What things need to be taken in consideration before doing that ? > What is the value of SHMAX & SHMALL if u have 16 GB RAM for Postgres > Server ? Well, those two values actually define kernel limits for shared memory segments (i.e. memory shared by multiple processes, in this case the postmaster proces and backends). So it's rather a question of tuning shared_buffers (because that's the shared memory segment) and then setting those two values. SHMMAX - max. size of a single shared segment (in bytes) SHMALL - total size of shared segments (in pages, page is usually 4kB) So if you decide you want 1GB shared buffers, you'll need at least this SHMMAX = 1024 * 1024 * 1024 (i.e. 1GB) SHMALL = 1024 * 256 (1GB in 4kB pages) (althouth the SHMALL should be higher, as there will be other processes that need shared memory). There's a lot of docs about this, e.g. this one (it's mostly for Oracle, but it describes the shared memory quite nicely): http://www.puschitz.com/TuningLinuxForOracle.shtml#SettingSharedMemory regards Tomas