On Tue, May 7, 2013 at 2:20 AM, Amit Langote <amitlangot...@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