Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id A54CD9FB381 for ; Mon, 26 Feb 2007 13:07:41 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 41617-03 for ; Mon, 26 Feb 2007 13:07:34 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by postgresql.org (Postfix) with ESMTP id 9A8C09FB530 for ; Mon, 26 Feb 2007 13:07:34 -0400 (AST) Received: from [192.168.1.50] (or-67-76-146-141.sta.embarqhsd.net [67.76.146.141]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id l1QH7YcH030905 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 26 Feb 2007 09:07:35 -0800 Message-ID: <45E313F3.9070605@commandprompt.com> Date: Mon, 26 Feb 2007 09:08:03 -0800 From: "Joshua D. Drake" Organization: Command Prompt, Inc. User-Agent: Thunderbird 1.5.0.9 (X11/20070103) MIME-Version: 1.0 To: Mark Stosberg CC: pgsql-performance@postgresql.org Subject: Re: low memory usage reported by 'top' indicates poor tuning? References: In-Reply-To: X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.88.5, clamav-milter version 0.88.5 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Mon, 26 Feb 2007 09:07:35 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/299 X-Sequence-Number: 23353 Mark Stosberg wrote: > Hello, > > I'm trying to make sense of the memory usage reported by 'top', compared > to what "pg_database_size" shows. Here's one result:' You are missing the most important parts of the equation: 1. What version of PostgreSQL. 2. What operating system -- scratch , I see freebsd 3. How big is your pg_dump in comparison to the pg_database_size() 4. What type of raid do you have? 5. What is your work_mem set to? 6. What about effective_cache_size? 7. Do you analyze? How often? > > select pg_size_pretty(pg_database_size('production')); > pg_size_pretty > ---------------- > 6573 MB > > Now, looking at memory use with "top", there is a lot memory that isn't > being used on the system: > > Mem: 470M Active, 2064M Inact > > ( 3 Gigs RAM, total ). > > Overall performance is decent, so maybe there's no > problem. However, I wonder if we've under-allocated memory to > PostgreSQL. (This is a dedicated FreeBSD DB server). > > Some memory settings include: > > shared_buffers = 8192 (we have 450 connections) > max_fsm_pages = 1250000 (we kept getting HINTs to bump it, so we did) > > Maybe we should be bumping up the "sort_mem" and "vacuum_mem" as well? > > I do sometimes see sorting and vacuuming as showing up as things I'd > like to run faster. > > This list has been a great resource for performance tuning help, and I > continue to appreciate your help. We've used PostgreSQL on every project > we've had a choice on for the last 10 years. (Has it been that long?!) > We've never regretted it once. > > Mark > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster > -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/ Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate PostgreSQL Replication: http://www.commandprompt.com/products/