Re: Should commit_delay be PGC_SIGHUP?

From: Noah Misch <noah(at)leadboat(dot)com>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Should commit_delay be PGC_SIGHUP?
Date: 2013-03-22 02:01:09
Message-ID: 20130322020109.GA13105@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 20, 2013 at 09:50:55PM +0000, Peter Geoghegan wrote:
> The fact is that whichever backend happens to end up becoming the
> group commit leader from one XLogFlush() call to the next is, for all
> practical purposes, unpredictable. You cannot reasonably hope to avoid
> a delay within an important transaction that needs to prioritize
> keeping its own latency low over total cluster throughput. If you set
> commit_delay to 0 in your important transaction with this is mind,
> your chances of becoming the group commit leader and avoiding the
> delay are slim to almost none. Much more often than not, the important
> transaction will end up becoming a group commit follower, and it'll
> still spend a significant fraction of commit_delay (about 1/2, on
> average) blocking on LWLockAcquireOrWait().

I acknowledge that "SET commit_delay = 0" does not usefully reduce latency for
a transaction running on a system subject to a uniform, high commit rate. It
is useful for other things. Suppose you have a low-concurrency system with
commit_delay=0 in postgresql.conf, but you occasionally spin up a parallel
task that benefits from nonzero commit_delay. Changing commit_delay in the
task's sessions is a decent approximation of, and more convenient than,
temporarily modifying postgresql.conf.

--
Noah Misch
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Farina 2013-03-22 02:04:16 Re: postgres_fdw vs data formatting GUCs (was Re: [v9.3] writable foreign tables)
Previous Message Jeff Davis 2013-03-22 01:04:45 Re: Enabling Checksums