Thread: Should bgwriter log checkpoint start/end?

Should bgwriter log checkpoint start/end?

From
Tom Lane
Date:
In previous releases it was possible to observe whether an automatic
checkpoint was in progress by looking to see if there was a postmaster
child process doing one.  In 8.0 this will not work because the bgwriter
is always there.  I am thinking that for tasks such as performance
debugging it would be a good idea if the bgwriter could emit postmaster
log messages at start and end of a checkpoint.  However, this should
probably not happen at the default LOG level since it would clutter the
logs with perfectly routine messages.  Any opinions about what elog
level to use for this?
        regards, tom lane


Re: Should bgwriter log checkpoint start/end?

From
Simon Riggs
Date:
On Tue, 2004-10-26 at 23:44, Tom Lane wrote:
> In previous releases it was possible to observe whether an automatic
> checkpoint was in progress by looking to see if there was a postmaster
> child process doing one.  In 8.0 this will not work because the bgwriter
> is always there.  I am thinking that for tasks such as performance
> debugging it would be a good idea if the bgwriter could emit postmaster
> log messages at start and end of a checkpoint.  However, this should
> probably not happen at the default LOG level since it would clutter the
> logs with perfectly routine messages.  Any opinions about what elog
> level to use for this?
> 

Yes, please.

The end message should say:
- checkpoint duration
- blocks written
- number of xlog files recycled

The last one can then replace the multiple recycled file messages, or at
least push them down to DEBUG2.

For now, DEBUG1. Longer term, we need to discuss a "performance log" or
some place to put regularly collected performance statistics, rather
than site specific ones.

-- 
Best Regards, Simon Riggs



Re: Should bgwriter log checkpoint start/end?

From
Greg Stark
Date:
Simon Riggs <simon@2ndquadrant.com> writes:

> For now, DEBUG1. Longer term, we need to discuss a "performance log" or
> some place to put regularly collected performance statistics, rather
> than site specific ones.

As a data point, with Oracle we often found it useful that Oracle logs all
checkpoints. One log entry every few minutes really isn't an excessive amount
of logging, even if it is a routine non-error condition.

I would suggest a higher level, INFO or NOTICE.

-- 
greg