Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 4D6C91337C07 for ; Wed, 23 Mar 2011 11:42:41 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 51162-07-3 for ; Wed, 23 Mar 2011 14:42:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from elizabeth.gransy.com (elizabeth.gransy.com [89.187.132.199]) by mail.postgresql.org (Postfix) with ESMTP id 5D6441337BCC for ; Wed, 23 Mar 2011 11:41:40 -0300 (ADT) Received: from sq.gransy.com (localhost [127.0.0.1]) by elizabeth.gransy.com (Postfix) with ESMTP id 8ABA715E4143; Wed, 23 Mar 2011 15:41:40 +0100 (CET) Received: from 85.160.232.114 (SquirrelMail authenticated user tv@fuzzy.cz) by sq.gransy.com with HTTP; Wed, 23 Mar 2011 15:41:40 +0100 Message-ID: In-Reply-To: References: Date: Wed, 23 Mar 2011 15:41:40 +0100 Subject: Re: buffercache/bgwriter From: tv@fuzzy.cz To: "Uwe Bartels" Cc: pgsql-performance@postgresql.org User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.121 tagged_above=-10 required=5 tests=BAYES_20=-0.001, URI_HEX=1.122 X-Spam-Level: * X-Archive-Number: 201103/282 X-Sequence-Number: 42961 > Hi, > > I have very bad bgwriter statistics on a server which runs since many > weeks > and it is still the same after a recent restart. > There are roughly 50% of buffers written by the backend processes and the > rest by checkpoints. > The statistics below are from a server with 140GB RAM, 32GB shared_buffers > and a runtime of one hour. > > As you can see in the pg_buffercache view that there are most buffers > without usagecount - so they are as free or even virgen as they can be. > At the same time I have 53% percent of the dirty buffers written by the > backend process. There are some nice old threads dealing with this - see for example http://postgresql.1045698.n5.nabble.com/Bgwriter-and-pg-stat-bgwriter-buffers-clean-aspects-td2071472.html http://postgresql.1045698.n5.nabble.com/tuning-bgwriter-in-8-4-2-td1926854.html and there even some nice external links to more detailed explanation http://www.westnet.com/~gsmith/content/postgresql/chkp-bgw-83.htm regards Tomas