XLogFlush invoked about twice as much after 9.2 group commit enhancement

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: XLogFlush invoked about twice as much after 9.2 group commit enhancement
Date: 2013-05-07 09:20:18
Message-ID: CA+HiwqHvR=Yd5VebbrywoAjdT5883-wLEeJb7qn_W6KjPvRsiA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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. Since, XLogFlush is the place where this patch offers the said
performance gain by alleviating the lock contention on WALWriteLock
using the new LWLockAcquireOrWait(). So far so good. I do not
understand why XLogFlush is invoked twice (as see from the profiling
results) as an effect of this patch.

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).

Using:

pgbench scale=10

shared_buffers=256MB
max_connections=1000
checkpoint_segments=15
synchronous_commit=on

Comments?
--

Amit Langote

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2013-05-07 09:20:34 Re: [PATCH] add long options to pgbench (submission 1)
Previous Message Mark Kirkwood 2013-05-07 08:17:51 Re: In progress INSERT wrecks plans on table