Re: Too frequent checkpoints ? - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: Too frequent checkpoints ?
Date
Msg-id CAMkU=1yejKs7hnR4BnF7CDaM7cp1c0SeQ2henQXYv9EXf0thoA@mail.gmail.com
Whole thread Raw
In response to Too frequent checkpoints ?  (Pavan Deolasee <pavan.deolasee@gmail.com>)
Responses Re: Too frequent checkpoints ?
List pgsql-hackers
On Fri, Feb 8, 2013 at 2:37 AM, Pavan Deolasee <pavan.deolasee@gmail.com> wrote:
> I was looking at the vacuum/visibility bug that Jeff Janes reported
> and brought up the server with the data directory he has shared. With
> his configuration,
>
....
> 3092  2013-02-08 02:30:31.327 PST:LOG:  checkpoints are occurring too
> frequently (0 seconds apart)
> 3092  2013-02-08 02:30:31.327 PST:HINT:  Consider increasing the
> configuration parameter "checkpoint_segments".
...
>
> I wonder if this is all expected. The database is getting ZERO
> activity. There are no connections open at this time. The checkpoints
> are happening at every 30 seconds and new WAL files are being created,
> AFAIK because the old ones are getting archived. Can't we be smart
> about not archiving new files if we did not generate any new WAL since
> the last archive ?

Yeah, this is a known issue.  We skip two consecutive checkpoints
(forced by checkpoint_timeout) with no intervening activity, and we
skip two consecutive log switches (forced by archive_timeout) with no
intervening activity, but when you put them both together neither one
gets skipped because each one counts as "intervening activity" from
the other ones perspective.  I think that at one point this was
considered desirable, as the arrival of log files in the archive, even
if they had no real content, was viewed as proof of life.  You can set
up archive_command to send you an email if an archive fails, but the
same thing that prevents the archive might prevent the email from
arriving.


> Also, the log says "checkpoints are occurring too frequently (0
> seconds apart)". But that looks wrong too. Checkpoints are really
> happening at 30 seconds apart and not 0 as the log message claims.

I noticed that as well, and I think it might be a regression.  I'll
run a bisection on it if I get a chance.

Cheers,

Jeff



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Too frequent checkpoints ?
Next
From: Jeff Janes
Date:
Subject: Re: Vacuum/visibility is busted