Skip site navigation (1) Skip section navigation (2)

Re: Details about pg_stat_bgwriter

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: Thomas Kellerer <spam_eater(at)gmx(dot)net>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Details about pg_stat_bgwriter
Date: 2010-06-09 06:45:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
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

In response to

pgsql-admin by date

Next:From: Thomas KellererDate: 2010-06-09 07:00:41
Subject: Re: Details about pg_stat_bgwriter
Previous:From: Scott MarloweDate: 2010-06-09 06:08:58
Subject: Re: optimizer behavior in the case of highly updated tables

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group