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 297569FA147 for ; Wed, 5 Jul 2006 20:50:00 -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 32365-10 for ; Wed, 5 Jul 2006 20:49:50 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from linda-3.paradise.net.nz (bm-3a.paradise.net.nz [203.96.152.182]) by postgresql.org (Postfix) with ESMTP id 215159FA605 for ; Wed, 5 Jul 2006 20:49:49 -0300 (ADT) Received: from smtp-2.paradise.net.nz (tclsnelb1-src-1.paradise.net.nz [203.96.152.172]) by linda-3.paradise.net.nz (Paradise.net.nz) with ESMTP id <0J1Y00076FIZZY@linda-3.paradise.net.nz> for pgsql-performance@postgresql.org; Thu, 06 Jul 2006 11:49:47 +1200 (NZST) Received: from [192.168.1.11] (218-101-28-133.dsl.clear.net.nz [218.101.28.133]) by smtp-2.paradise.net.nz (Postfix) with ESMTP id DD71AAC2CA; Thu, 06 Jul 2006 11:49:46 +1200 (NZST) Date: Thu, 06 Jul 2006 11:49:40 +1200 From: Mark Kirkwood Subject: Re: Opteron/FreeBSD/PostgreSQL performance poor In-reply-to: <44AC00B5.6030207@noaa.gov> To: andy rost Cc: Stephen Frost , pgsql-performance@postgresql.org, Bill.Sites@noaa.gov Message-id: <44AC5014.1070605@paradise.net.nz> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=us-ascii Content-transfer-encoding: 7bit User-Agent: Thunderbird 1.5.0.4 (X11/20060704) References: <44ABCFF4.3010007@noaa.gov> <20060705154656.GS22057@kenobi.snowman.net> <44AC00B5.6030207@noaa.gov> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/33 X-Sequence-Number: 19893 andy rost wrote: > >>> effective_cache_size = 27462 # typically 8KB each >> >> >> This seems like it might be a little low... How much memory do you have >> in the system? Then again, with your shared_mem set so high, perhaps >> it's not that bad, but it might make sense to swap those two settings, >> or at least that'd be a more common PG setup. > > Oops, forgot to mention that we have 6 Gigs of memory. This value was > set based on sysctl -n vfs.hibufspace / 8192 > That vfs.hibufspace sysctl is a little deceptive IMHO - e.g on my FreeBSD 6.1 system with 2G of ram it says 117276672 (i.e. about 112M), but I have a 1G file cached entirely in ram at the moment... In FreeBSD file pages are actually kept in the 'Inactive' section of memory, the 'Buffer' section is used as a 'window' to read 'em. For instance on my system I see: Mem: 4192K Active, 1303M Inact, 205M Wired, 12K Cache, 112M Buf, 491M Free So my 1G file is cached in the 1303M of 'Inactive', but I have 112M of buffer window for accessing this (and other) cached files. Now, I may not have explained this that well, and it is quite confusing... but hopefully you get the idea! Now on the basis of the figures provided: - max_connections=102 , each with work_mem=10000 (approx 1G in total) - shared buffers=125000 (1G total) it looks like you are only using about 2G of your 6G, so there is a lot left for caching file pages (lets say 3-4G or so). I would think you can happily set effective_cache_size=393216 (i.e. 3G/8192). This will have the side effect of encouraging more index scans (probably what you want I think). Best wishes Mark