Re: [COMMITTERS] pgsql: Optimize commit_siblings in two ways to improve group commit. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [COMMITTERS] pgsql: Optimize commit_siblings in two ways to improve group commit.
Date
Msg-id 21815.1291845453@sss.pgh.pa.us
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Optimize commit_siblings in two ways to improve group commit.  (Greg Smith <greg@2ndquadrant.com>)
Responses Re: [COMMITTERS] pgsql: Optimize commit_siblings in two ways to improve group commit.  (Greg Smith <greg@2ndquadrant.com>)
List pgsql-hackers
Greg Smith <greg@2ndquadrant.com> writes:
> I then posted the patch and added it to the January CF.  Unbeknownst to 
> me until today, Simon had the same multi-year "this itches and I can't 
> make it stop" feel toward these parameters, and that's how it jumped the 
> standard process.

I think pretty much everybody who's looked at that code had the same
feeling.  If Simon hadn't taken it, I might have.

Jignesh's explanation of what the actual usefulness of the code is
finally made sense to me: the sleep calls effectively synchronize
multiple nearby commits to happen at the next scheduler clock tick,
and then whichever one grabs the WALWriteLock first does the work.
If you've got a high enough commit volume that this is likely to
be a win, then it's unclear that taking ProcArrayLock (even shared)
to check for guys who might commit shortly is a net win.  Moreover,
it's likely that that heuristic will exclude the last-to-arrive
process who otherwise could have participated in a group flush.

I'm not entirely convinced that zero commit_siblings is a better
default than small positive values, but it's certainly plausible.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: Review: Extensions Patch
Next
From: Dimitri Fontaine
Date:
Subject: Re: Review: Extensions Patch