Re: XLogFlush invoked about twice as much after 9.2 group commit enhancement - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: XLogFlush invoked about twice as much after 9.2 group commit enhancement
Date
Msg-id CAMkU=1xrKHKr6-SjcU7DoTbp1wY3XOj5dV4pO7n9rR+JQ-htig@mail.gmail.com
Whole thread Raw
In response to XLogFlush invoked about twice as much after 9.2 group commit enhancement  (Amit Langote <amitlangote09@gmail.com>)
Responses Re: XLogFlush invoked about twice as much after 9.2 group commit enhancement  (Amit Langote <amitlangote09@gmail.com>)
Re: XLogFlush invoked about twice as much after 9.2 group commit enhancement  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
On Tue, May 7, 2013 at 2:20 AM, Amit Langote <amitlangote09@gmail.com> wrote:
Hello,

I have been trying to understand how group commit implementation works
the way it does after 9.2 group commit enhancement patch
(9b38d46d9f5517dab67dda1dd0459683fc9cda9f on REL9_2_STABLE). I admit
it's a pretty old commit though I seek some clarification as to how it
provides the performance gain as it does. Also, I have observed some
behavior in this regard that I could not understand.

Profiling results show that XLogFlush is called about twice as much
after this patch while for XLogWrite count remains about same as
before.

Are you sure you properly cleared out the stats between profiling sessions?  Also, XLogFlush gets called by background processes like autovac, checkpointer and bgwriter, in addition to being called by committing processes.  If one profiled session contained a checkpoint and other did not, or one just idled a lot longer between when the benchmark finished and when you shutdown the server, perhaps that explains it.

Anyway, I don't see this behavior change when turning on wal_debug and looking in the logfiles for 'xlog flush request' messages.


I used "pgbench -c 32 -t 1000 pgbench" in both cases with TPS result
(after applying the patch) not being significantly different (as in
not twice as much on my system).

1000 is a very small number of transactions to run a benchmark for.  What was the duration?

What were the actual TPS numbers?  Does your hardware honor fsyncs?

Cheers,

Jeff

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: issues with dropped columns in plpgsql code again
Next
From: Szymon Guz
Date:
Subject: Re: issues with dropped columns in plpgsql code again