Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 722E064FCEE for ; Thu, 25 Dec 2008 17:37:12 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 31563-10 for ; Thu, 25 Dec 2008 17:37:10 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f19.google.com (mail-gx0-f19.google.com [209.85.217.19]) by mail.postgresql.org (Postfix) with ESMTP id A235364FC65 for ; Thu, 25 Dec 2008 17:37:09 -0400 (AST) Received: by gxk12 with SMTP id 12so2374765gxk.19 for ; Thu, 25 Dec 2008 13:37:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :sender:to:subject:mime-version:content-type:x-google-sender-auth; bh=mvQLVOO1kszmxQz+en6kC5w61PAyZ/AfSPBOB6iJ44Y=; b=jS5fsyBqL5Y5o/BpJSg8UTP1KZDjbOl+NeCOlf+qicaXSF19RN6tx66HPh+kCMtOzQ DS89pGXqliOQ/F+rNNalrYVB9VT94vsLJ5pV/3kW2R95kFPYVBkouO3LS49/x82hySFL ZxZWPjR+xXBUwC2Tg17tcKKOqhhSCW3dx1zog= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:sender:to:subject:mime-version :content-type:x-google-sender-auth; b=CzriRiZ+834RELVOBzqwg62sXWl40+dlWLnlEQExbryfgPTXQCRE7lNmbAIrSZ88/x MQTc8bkkn8ROipE/BqyvniWFacptQPBT9UFCyHpcz4aekW6pvSuSRi/3tA2IgtvKl8KP 16e1zJAi8DXMS0TfXWqc1GE/UoSQ4SVp1E50Q= Received: by 10.90.93.13 with SMTP id q13mr5035153agb.120.1230241028551; Thu, 25 Dec 2008 13:37:08 -0800 (PST) Received: by 10.90.87.19 with HTTP; Thu, 25 Dec 2008 13:37:08 -0800 (PST) Message-ID: Date: Fri, 26 Dec 2008 00:37:08 +0300 From: "Dmitry Koterov" Reply-To: dmitry@koterov.ru To: "Postgres General" Subject: Bgwriter and pg_stat_bgwriter.buffers_clean aspects MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_75339_11363533.1230241028544" X-Google-Sender-Auth: dfe376afa7a52536 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200812/845 X-Sequence-Number: 141977 ------=_Part_75339_11363533.1230241028544 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello. I am trying to tune PostgreSQL write parameters to make writing operation fast on a heavy-loaded database (a lot of inserts/updates). After resetting the pg_stat_bgwriter statistics (I do it by deleting global/pgstat.stat file and restarting PostgreSQL) I monitor the following: # select * from pg_stat_bgwriter; checkpoints_timed | checkpoints_req | buffers_checkpoint | buffers_clean | maxwritten_clean | buffers_backend | buffers_alloc -------------------+-----------------+--------------------+---------------+------------------+-----------------+--------------- 0 | 0 | 0 | 0 | 0 | 164 | 6653 So, you see that just after resetting the statistics we have a large value in buffers_backend. Why? Documentation: http://www.westnet.com/~gsmith/content/postgresql/chkp-bgw-83.htm says that "buffers_backend ------=_Part_75339_11363533.1230241028544 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello.

I am trying to tune PostgreSQL write parameters to make writing operation fast on a heavy-loaded database (a lot of inserts/updates).
After resetting the pg_stat_bgwriter statistics (I do it by deleting global/pgstat.stat file and restarting PostgreSQL) I monitor the following:

# select * from pg_stat_bgwriter;
 checkpoints_timed | checkpoints_req | buffers_checkpoint | buffers_clean | maxwritten_clean | buffers_backend | buffers_alloc
-------------------+-----------------+--------------------+---------------+------------------+-----------------+---------------
                 0 |               0 |                  0 |             0 |                0 |             164 |          6653

So, you see that just after resetting the statistics we have a large value in buffers_backend. Why?
Documentation: http://www.westnet.com/~gsmith/content/postgresql/chkp-bgw-83.htm
says that "buffers_backend ------=_Part_75339_11363533.1230241028544--