Re: Instrument checkpoint sync calls

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Instrument checkpoint sync calls
Date: 2010-11-15 00:04:56
Message-ID: 4CE07928.3010507@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander wrote:
>> I think that it's reasonable for the sort of people who turn log_checkpoints
>> on to also get the sync summary line, thus it being logged at LOG level.
>>
>
> In that case, wouldn't it make more sense to add a couple of more
> fields to the existing line? Easier to post-process the logfile that
> way...
>

It might. One trade-off is that if you're looking at the sync write
detail, the summary comes out in a similar form. And it was easy to put
in here--I'd have to return some new data out of the sync phase call in
order for that to show up in the main log. If there's general buy-in on
the idea, I could do all of that.

>> I personally think that if you're
>> already making an fsync call and have log_checkpoints on, the additional
>> overhead of also timing that fsync is minimal even on platforms where timing
>> is slow (I don't have such a system to test that assumption however)...
> It sounds like it should be - but that should be possible to measure, no?
>

What I was alluding to is that I know gettimeofday executes fast on my
Linux system here, so even if I did measure the overhead and showed it's
near zero that doesn't mean it will be so on every platform. The "how
long does it take to find out the current time on every supported
PostgreSQL platform?" question is one I'd like to have an answer to, but
it's hard to collect properly. All I know is that I don't have any
system where it's slow to properly test again here.

--
Greg Smith 2ndQuadrant US greg(at)2ndQuadrant(dot)com Baltimore, MD
PostgreSQL Training, Services and Support www.2ndQuadrant.us

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2010-11-15 00:06:36 Per-column collation
Previous Message Greg Smith 2010-11-14 23:59:03 Re: pg_stat_bgwriter broken?