Re: Checkpoint question

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Checkpoint question
Date: 2006-01-12 21:53:09
Message-ID: 20060112215309.GH63175@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 12, 2006 at 04:50:30AM -0500, Qingqing Zhou wrote:
>
>
> On Thu, 12 Jan 2006, Simon Riggs wrote:
> >
> > The only buffers this will miss are ones that were clean throughout the
> > whole of the last checkpoint cycle, yet have been dirtied between the
> > start of the checkpoint pass and when the pass reaches it.
>
> I agree on the analysis but I am not sure current interval of doing a
> checkpoint. So it depends. If the checkpoint on an io-intensive machine
> the interval I guess would not be small. Also, in this environment, one
> more round of lock cycle should be relatively cheap. But we currently
> don't have any numbers on hand ...

It sounds like worrying about this would be much more interesting on a
machine that is seeing both a fairly heavy IO load (meaning checkpoint
will both take longer and affect other workloads more) and is seeing a
pretty high rate of buffer updates (meaning that we'd likely do a bunch
of extra work as part of the checkpoint if we didn't take note of
exactly what buffers needed to be flushed). Unfortunately I don't think
there's any way for the backend to know much about either condition
right now, so it couldn't decide when it made sense to make a list of
buffers to flush. Maybe in the future...

As for the questionable benefit to delaying work for bgwriter or next
checkpoint, I think there's a number of scenarios where it would make
sense. A simple example is doing some kind of processing once a minute
that's IO intensive with default checkpoint timing. Sometimes a
checkpoint will occur at the same time as the once-a-minute process, and
in those cases reducing the amount of work the checkpoint does will
definately help even out the load on the machine.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Qingqing Zhou 2006-01-12 22:00:49 Re: Checkpoint question
Previous Message Alon Goldshuv 2006-01-12 15:10:06 Re: Libpq COPY optimization