pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Smith <greg@2ndquadrant.com>
To: Scott Marlowe <scott.marlowe@gmail.com>
Cc: Thomas Kellerer <spam_eater@gmx.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: Details about pg_stat_bgwriter
Date: Wed, 09 Jun 2010 02:45:13 -0400
Message-ID: <4C0F3879.8020900@2ndquadrant.com> (raw)
In-Reply-To: <AANLkTink6aRAdHYmpKy_M_m7uw35kl69jbjitOkd5QiQ@mail.gmail.com>
References: <hulnta$mqe$1@dough.gmane.org>
	<4C0E7E3E.2070309@2ndquadrant.com>
	<4C0F2339.8070403@2ndquadrant.com>
	<AANLkTink6aRAdHYmpKy_M_m7uw35kl69jbjitOkd5QiQ@mail.gmail.com>

Scott Marlowe wrote:
>> -Average checkpoint frequency
>> -Average size of each checkpoint
>> -Average rate at which new buffers are allocated
>> -Average rate of writes out of the buffer cache
>> -Percentage of writes done by checkpoints, the background writer LRU
>> cleaner, and client backends
>>     
>
> I think you get all or most of that if you just log checkpoints.
>   

If you turned on log_checkpoints, and you went through a whole stack of 
logs summarizing the data it writes out, you can derive the first two of 
those from it.  I happen to think that sampling two data points and 
pasting into a spreadsheet is less hassle to deal with, and the data is 
definitely there by default.  You can answer questions like "what's the 
biggest checkpoint I've seen?" from the stuff in the logs a bit easier 
than from pg_stat_bgwriter.

After for the rest, checkpoints are one of the three possible ways that 
buffers can be written out.  The other two are the background writer's 
cleaning and client backends.  log_checkpoints gives you the size of one 
of those sources of writes.  You can also compute an estimated 
proportion between the three types of writes from a single snapshot of 
pg_stat_bgwriter data.  But that doesn't help once you've reached the 
point where you want to change something and measure how response 
changes afterwards.  That requires more regularly sampling the data, so 
you have a delta between two times.

-- 
Greg Smith  2ndQuadrant US  Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com   www.2ndQuadrant.us




view thread (8+ messages)  latest in thread

Message-ID: <4C0F3879.8020900@2ndquadrant.com>
Permalink:  ../4C0F3879.8020900@2ndquadrant.com/
Also on:    postgresql.org/message-id/4C0F3879.8020900@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: greg@2ndquadrant.com, scott.marlowe@gmail.com, spam_eater@gmx.net
  Subject: Re: Details about pg_stat_bgwriter
  In-Reply-To: <4C0F3879.8020900@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox