X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 1318E9FA418 for ; Thu, 31 Aug 2006 15:28:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 37526-06 for ; Thu, 31 Aug 2006 15:28:34 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id 1A9629FB3D6 for ; Thu, 31 Aug 2006 15:28:33 -0300 (ADT) Received: (qmail 5557 invoked from network); 31 Aug 2006 18:28:33 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 31 Aug 2006 18:28:33 -0000 In-Reply-To: References: <44F55A7F.40305@sorbs.net> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <43D1B021-7BDB-4CC4-BB7A-A6DFDAEF1537@fastcrypt.com> Cc: "Pgsql-Performance ((((E-mail))))" Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: performance problems. Date: Thu, 31 Aug 2006 14:28:31 -0400 To: Vivek Khera X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.043 tagged_above=0 required=5 tests=AWL, SPF_PASS X-Spam-Level: X-Archive-Number: 200608/499 X-Sequence-Number: 20684 On 31-Aug-06, at 2:15 PM, Vivek Khera wrote: > > On Aug 30, 2006, at 7:48 PM, Dave Cramer wrote: > >> Actually unless you have a ram disk you should probably leave >> random_page_cost at 4, shared buffers should be 2x what you have >> here, maintenance work mem is pretty high >> effective cache should be much larger 3/4 of 4G or about 360000 >> > > I've been pondering bumping up SHM settings more, but it is a very > big imposition to have to restart the production server to do so. > This weekend being a long weekend might be a good opportunity to > try it, though... > > As for maintenence mem, when you have HUGE tables, you want to give > a lot of memory to vacuum. With 4GB of RAM giving it 512MB is not > an issue. > > The effective cache size is the big issue with FreeBSD. There are > opposing claims of how much memory it will use for cache, and throw > in the kern.ipc.shm_use_phys sysctl which causes SHM to bypass the > VM system entirely, and who knows what's going on. Yes, I have to admit, the setting I proposed works well for linux, but may not for bsd. > >> Setting work _mem this high should be done with caution. From the >> manual "Note that for a complex query, several sort or hash >> operations might be running in parallel; each one will be allowed >> to use as much memory as this value specifies before it starts to >> put data into temporary files. Also, several running sessions >> could be doing such operations concurrently. So the total memory >> used could be many times the value of work_mem" > > Again, with boat-loads of RAM why not let the queries use it? We > only have a handful of connections at a time so that's not eating > up much memory... > As long as you are aware of the ramifications....