Re: Emit "checkpoint skipped because system is idle" message at LOG level if log_checkpoints is set

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: pryzby(at)telsasoft(dot)com, dilipbalaut(at)gmail(dot)com, bharath(dot)rupireddyforpostgres(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Emit "checkpoint skipped because system is idle" message at LOG level if log_checkpoints is set
Date: 2022-01-06 10:58:14
Message-ID: 20220106105814.icbz7giyt3qgdzqd@jrouhaud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 06, 2022 at 04:34:38PM +0900, Kyotaro Horiguchi wrote:
> At Wed, 5 Jan 2022 17:18:06 -0600, Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote in
> >
> > |commit 6ef2eba3f57f17960b7cd4958e18aa79e357de2f
> > |Author: Andres Freund <andres(at)anarazel(dot)de>
> > |Date: Thu Dec 22 11:31:50 2016 -0800
> > |
> > | Skip checkpoints, archiving on idle systems.
> >
> > Note that logging a message may not be benign ; I think it could cause the
> > disks to spin up, that would othewise have been in power saving mode,
> > especially if you log to syslog, which can issue fsync. Also, part of the
> > argument for enabling log_checkpoint by default was that a small, quiescent
> > instance would not write logs every 5 minutes.
>
> Agreed. -1 to just raising elevel of the message.

-1 too.

> If someone keen to show some debug messages, it is viable for
> arbitrary messages by lowering log_min_messages then inserting a
> custom filter to emit_log_hook. It invites some overhead on
> irrelevant processes, but that overhead would be avoidable with a
> *bit* dirty hack in the filter,
>
> We might want to discuss more convenient or cleaner way to get the
> same result.

We could add a checkpoint_skipped counter to pg_stat_bgwriter for instance.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2022-01-06 11:06:52 Re: Logical insert/update/delete WAL records for custom table AMs
Previous Message Japin Li 2022-01-06 10:50:45 Re: Index-only scan for btree_gist turns bpchar to char