Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A6A7C474E4E; Fri, 30 Aug 2002 10:51:17 -0400 (EDT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by postgresql.org (Postfix) with ESMTP id 43CE44761F7; Fri, 30 Aug 2002 10:51:15 -0400 (EDT) Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 (Debian)) id 17kn7I-0003fO-00; Fri, 30 Aug 2002 10:51:20 -0400 Date: Fri, 30 Aug 2002 10:51:20 -0400 From: Andrew Sullivan To: pgsql-admin@postgresql.org, pgsql-general@postgresql.org Subject: Re: [GENERAL] Max Shared Memory Message-ID: <20020830105120.B10695@mail.libertyrms.com> Mail-Followup-To: Andrew Sullivan , pgsql-admin@postgresql.org, pgsql-general@postgresql.org References: <1030710789.18312.9.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <1030710789.18312.9.camel@localhost.localdomain>; from eric@did-it.com on Fri, Aug 30, 2002 at 08:33:08AM -0400 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/408 X-Sequence-Number: 5522 On Fri, Aug 30, 2002 at 08:33:08AM -0400, Ericson Smith wrote: > Hi, > > We have a server with 4GB of RAM running RH7.3 with stock kernel and > Postgresql 7.2 > > Currently we have 1.6GB Shared Memory installed. What is the max amount > of shared memory we can allocate here? Does anyone have any real world > experience with large shared memory installations that could help? There has been a _lot_ of discussion on this matter recently on the list -- you might want to check the archives from the last few months. There are three schools of thought: 1. Set the shared buffers to a large-ish, but not huge setting (maybe 25% of physical memory), and let the filesystem buffers handle the rest. 2. Keep increasing the shared buffers setting until you start to cause swapping, and then ease back. 3. Set the shared buffers to some basic, minimal setting -- a few thousand, perhaps -- and let the filesystem buffers handle most of the traffic, since a call to the filesystem buffer isn't that expensive anyway. The argument against 1 (and in favour of 3) is that 1 more or less causes you to cache twice: once in the shared buffer, and once in the filesystem buffer. The argument against 2 is that it is extremely easy to get it wrong, and to cause accidental swapping. The argument against 3 is that it costs more than nothing to make the kernel call to get the filesystem buffer, and all those little more than nothing costs add up. The best way to decide for your case is to try various settings, and run some benchmarks. But that is extremely tricky to get good results from; I have tried dozens of combinations, and each one has its limitations, at least on Solaris. I used to be a very big fan of 3, but I have found that some larger amount of memory in the shared buffer (more than half a gig, anyway) pays off on Solaris in a way I never found it doing on Linux. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110