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 6F7793A44DA for ; Wed, 19 Jan 2005 23:52:27 +0000 (GMT) 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 86036-02 for ; Wed, 19 Jan 2005 23:52:20 +0000 (GMT) Received: from cmailg2.svr.pol.co.uk (cmailg2.svr.pol.co.uk [195.92.195.172]) by svr1.postgresql.org (Postfix) with ESMTP id 523123A4458 for ; Wed, 19 Jan 2005 23:52:19 +0000 (GMT) Received: from modem-3419.lion.dialup.pol.co.uk ([217.135.173.91] helo=192.168.0.102) by cmailg2.svr.pol.co.uk with esmtp (Exim 4.14) id 1CrPcW-0001kE-7N; Wed, 19 Jan 2005 23:52:16 +0000 Subject: Re: Swapping on Solaris From: Simon Riggs To: Kevin Schroeder Cc: pgsql-performance@postgresql.org In-Reply-To: <014801c4fe3d$2a2478f0$0200a8c0@WORKSTATION> References: <042a01c4fdaf$fbb3b860$0200a8c0@WORKSTATION> <41EE0F05.9080901@coretech.co.nz> <41EE65FC.2000909@rentec.com> <00d601c4fe33$89682eb0$0200a8c0@WORKSTATION> <41EE7D19.4060503@rentec.com> <014801c4fe3d$2a2478f0$0200a8c0@WORKSTATION> Content-Type: text/plain Organization: 2nd Quadrant Date: Wed, 19 Jan 2005 23:47:04 +0000 Message-Id: <1106178424.14384.373.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.04 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/251 X-Sequence-Number: 9941 On Wed, 2005-01-19 at 09:40 -0600, Kevin Schroeder wrote: > I may be asking the question the wrong way, but when I start up PostgreSQL > swap is what gets used the most of. I've got 1282MB free RAM right now and > and 515MB swap in use. Granted, swap file usage probably wouldn't be zero, > but I would guess that it should be a lot lower so something must be keeping > PostgreSQL from using the free RAM that my system is reporting. For > example, one of my postgres processes is 201M in size but on 72M is resident > in RAM. That extra 130M is available in RAM, according to top, but postgres > isn't using it. You probably need to look at the way Solaris memory allocation works. On Linux 2.6, my understanding is that if a process allocates memory, but doesn't actually use it, then the OS is smart enough to swap the overallocated portion out to swap. The effect of that is that the program stays happy because it has all the "memory" it thinks it needs, while the OS is happy because it conserves it valuable physical RAM for memory that is actually being used. If what I say is correct, you should actually observe very low swapping I/O rates on the system. Anyway, look at how the algorithms work if you are worried by what you see. But mostly, if the system is performing OK, then no need to worry - if your only measure of that is system performance data then you need to instrument your application better, so you can look at the data that really matters. -- Best Regards, Simon Riggs