Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id E2277633E58 for ; Tue, 30 Mar 2010 11:58:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 14013-09 for ; Tue, 30 Mar 2010 14:57:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by mail.postgresql.org (Postfix) with ESMTP id 2ACC5633AAC for ; Tue, 30 Mar 2010 11:57:46 -0300 (ADT) Received: by fxm25 with SMTP id 25so44256fxm.3 for ; Tue, 30 Mar 2010 07:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=c4HJ2BMI+axJGH4fs0v8k1n4kfmlPDtWDxiPSv5ha24=; b=PyBMfbetLsj7hFthKGKnntPiaIJ0bnsAqPXPQRRX9j3uOaRDeR1xxz2RhHNJUqIeVi 2ja4HTCd0VMoE9cBUiFXHWJNQ+RTwtPJrHKG1V8FvFSO9Nw0H2voNI/Erjzmoov0qYTE zc5scj08/hkYuNReWuCRlqEw2mNQiQR7pAFII= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=fPkPZ4S70mA8gJ+FcBtII7peIB61mokceWS9OklqyIPbPFMwx8srAvDjBEBXiWfN6W F3CorBqC8kAJALdsRtbfTIu8fnfK7VY6dxRHcQ456XbK9HKD8NFRp9D5DZvvONeI4TKs F+QCIEYbb7uEod81ZcEdfuKLs9fynamE77KnA= MIME-Version: 1.0 Received: by 10.239.161.83 with HTTP; Tue, 30 Mar 2010 07:57:44 -0700 (PDT) In-Reply-To: <04C98397-261D-4A50-99CB-61FA3E4A974B@richyen.com> References: <04C98397-261D-4A50-99CB-61FA3E4A974B@richyen.com> Date: Tue, 30 Mar 2010 10:57:44 -0400 Received: by 10.239.184.9 with SMTP id w9mr608518hbg.120.1269961064108; Tue, 30 Mar 2010 07:57:44 -0700 (PDT) Message-ID: <603c8f071003300757s39a9096eyc6ce6af4ecb396ff@mail.gmail.com> Subject: Re: why does swap not recover? From: Robert Haas To: Richard Yen Cc: pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.553 tagged_above=-10 required=5 tests=AWL=-0.813, BAYES_20=-0.74 X-Spam-Level: X-Archive-Number: 201003/388 X-Sequence-Number: 38213 On Fri, Mar 26, 2010 at 7:57 PM, Richard Yen wrote: > Note that it is constantly paging in, but never paging out. =A0This would= indicate that it's constantly reading from swap, but never writing out to = it. =A0Why would postgres do this? (postgres is pretty much the only thing = running on this machine). > > I'm planning on lowering the shared_buffers to a more sane value, like 25= GB (pgtune recommends this for a Mixed-purpose machine) or less (pgtune rec= ommends 14GB for an OLTP machine). =A0However, before I do this (and possib= ly resolve the issue), I was hoping to see if anyone would have an explanat= ion for the constant reading from swap, but never writing back. Reading a page in from swap still leaves that data on the disk. So it may be that you're reading in pages from disk, not modifying them, discarding them (without any need to write them out since they're still on disk), and then reading them in again when they're accessed again. ...Robert