Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A602E1337C09 for ; Mon, 2 May 2011 06:07:03 -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 10333-04 for ; Mon, 2 May 2011 09:06:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.catalyst.net.nz (bertrand.catalyst.net.nz [202.78.240.40]) by mail.postgresql.org (Postfix) with ESMTP id 2FF0B1337C21 for ; Mon, 2 May 2011 06:06:32 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id 24E0D32256 for ; Mon, 2 May 2011 21:06:30 +1200 (NZST) X-Virus-Scanned: Debian amavisd-new at catalyst.net.nz Received: from mail.catalyst.net.nz ([127.0.0.1]) by localhost (bertrand.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TCjvEbDBduTI for ; Mon, 2 May 2011 21:06:29 +1200 (NZST) Received: from [192.168.1.11] (122-60-64-230.jetstream.xtra.co.nz [122.60.64.230]) (Authenticated sender: mark.kirkwood) by mail.catalyst.net.nz (Postfix) with ESMTPSA id 760C732254 for ; Mon, 2 May 2011 21:06:29 +1200 (NZST) Message-ID: <4DBE7414.2010902@catalyst.net.nz> Date: Mon, 02 May 2011 21:06:28 +1200 From: Mark Kirkwood User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110419 Thunderbird/3.1.9 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: The right SHMMAX and FILE_MAX References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201105/12 X-Sequence-Number: 43521 On 01/05/11 18:48, Phoenix Kiula wrote: > Now, according to my reading in the PG manual and this list, a good > recommended value for SHMMAX is > > (shared_buffers * 8192) > > My postgresql.conf settings at the moment are: > > max_connections = 300 > shared_buffers = 300MB > effective_cache_size = 2000MB > > By this calculation, shared_b * 8192 will be: > > 2,457,600,000,000 > > That's a humongous number. So either the principle for SHMMAX is > amiss, or I am reading this wrongly? You are confusing shared_buffers expressed as "number of pages" with shared_buffers expressed as "MB". The docs are assuming you are working with the former (and would appear to be assuming your pagesize is 8K - which is teh default but not required to be the case). If you are showing shared_buffers as "MB" then obviously you cane set SHMMAX using the value multiplied by (1024*1024), so in your case: 300 * (1024*1024) = 314572800 However note that there are things other than shared_buffers require shared memory, so you'll need more than this. Use Greg's script. Cheers Mark