X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3EABE14B2825 for ; Wed, 11 Aug 2004 19:26:45 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 90274-10 for ; Wed, 11 Aug 2004 22:26:43 +0000 (GMT) Received: from tht.net (vista.tht.net [216.126.88.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3FF0414B2804 for ; Wed, 11 Aug 2004 19:26:39 -0300 (ADT) Received: from [134.22.70.202] (dyn-70-202.tor.dsl.tht.net [134.22.70.202]) by tht.net (Postfix) with ESMTP id 3370376A61; Wed, 11 Aug 2004 18:26:47 -0400 (EDT) Subject: Re: Hardware upgrade for a high-traffic database From: Rod Taylor To: Jason Coene Cc: 'Merlin Moncure' , 'Postgresql Performance' In-Reply-To: <200408112203.i7BM3d0E098570@mail.gotfrag.com> References: <200408112203.i7BM3d0E098570@mail.gotfrag.com> Content-Type: text/plain Message-Id: <1092263200.16087.121.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 11 Aug 2004 18:26:41 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/173 X-Sequence-Number: 7809 On Wed, 2004-08-11 at 18:03, Jason Coene wrote: > > -----Original Message----- > > From: Rod Taylor [mailto:pg@rbt.ca] > > Sent: Wednesday, August 11, 2004 5:46 PM > > To: Jason Coene > > Cc: 'Merlin Moncure'; Postgresql Performance > > Subject: Re: [PERFORM] Hardware upgrade for a high-traffic database > > > > > I'm wondering why our PG server is using so little memory... The system > > has > > > 2GB of memory, though only around 200MB of it are used. Is there a PG > > > > This is the second time you've said this. Surely you're not implying > > there is 1.8GB Free Memory -- rather than 1.8GB in Buffers or Cache. > > Hi Rod, > > I was looking at top and vmstat - which always show under 300MB "Active". > We may hit 400MB at peak. Everything I see (though this isn't my area of > expertise) points to most of the memory simply being unused. Results below, > am I missing something? This looks fine. The memory is not unused (only 5MB is actually empty) but is being used for disk cache. Active is memory used by programs and would need to be swapped if this space was needed. Inactive is memory that is generally dirty. Disk cache is often here. In your case, you likely write to the same pages you're reading from -- which is why this number is so big. It also explains why a checkpoint is a killer; a large chunk of this memory set needs to be pushed to disk. Cache is memory used generally for disk cache that is not dirty. It's been read from the disk and could be cleared immediately if necessary. Wired is memory that cannot be swapped. In your case, Shared Memory is probably Wired (this is good). There is another sysctl to check and set whether it is wired or swappable. Interesting (if dry) read: http://www.freebsd.org/doc/en_US.ISO8859-1/articles/vm-design/index.html