Commit 70ec2f8f authored by Tom Lane's avatar Tom Lane

Improve the documentation about commit_delay.

Clarify the docs explaining what commit_delay does, and add a
recommendation about a useful value for it, namely half of the single-page
fsync time reported by pg_test_fsync.  This is informed by testing of
the new-in-9.3 implementation of commit_delay; in prior versions it
was far harder to arrive at a useful setting.

In passing, do some wordsmithing and markup-fixing in the same general
area.

Also, change pg_test_fsync's default time-per-test from 2 seconds to 5.
The old value was about the minimum at which the results could be taken
seriously at all, and so seems a tad optimistic as a default.

Peter Geoghegan, reviewed by Noah Misch; some additional editing by me
parent dcafdbcd
......@@ -60,7 +60,7 @@ do { \
static const char *progname;
static int secs_per_test = 2;
static int secs_per_test = 5;
static int needs_unlink = 0;
static char full_buf[XLOG_SEG_SIZE],
*buf,
......
......@@ -1603,8 +1603,8 @@ include 'filename'
<title>Write Ahead Log</title>
<para>
See also <xref linkend="wal-configuration"> for details on WAL
and checkpoint tuning.
For additional information on tuning these settings,
see <xref linkend="wal-configuration">.
</para>
<sect2 id="runtime-config-wal-settings">
......@@ -1957,7 +1957,7 @@ include 'filename'
given interval. However, it also increases latency by up to
<varname>commit_delay</varname> microseconds for each WAL
flush. Because the delay is just wasted if no other transactions
become ready to commit, it is only performed if at least
become ready to commit, a delay is only performed if at least
<varname>commit_siblings</varname> other transactions are active
immediately before a flush would otherwise have been initiated.
In <productname>PostgreSQL</> releases prior to 9.3,
......@@ -1968,7 +1968,8 @@ include 'filename'
the first process that becomes ready to flush waits for the configured
interval, while subsequent processes wait only until the leader
completes the flush. The default <varname>commit_delay</> is zero
(no delay), and only honored if <varname>fsync</varname> is enabled.
(no delay). No delays are performed unless <varname>fsync</varname>
is enabled.
</para>
</listitem>
</varlistentry>
......
......@@ -36,8 +36,8 @@
difference in real database throughput, especially since many database servers
are not speed-limited by their transaction logs.
<application>pg_test_fsync</application> reports average file sync operation
time in microseconds for each wal_sync_method, which can be used to inform
efforts to optimize the value of <varname>commit_delay</varname>.
time in microseconds for each wal_sync_method, which can also be used to
inform efforts to optimize the value of <xref linkend="guc-commit-delay">.
</para>
</refsect1>
......@@ -72,8 +72,8 @@
<para>
Specifies the number of seconds for each test. The more time
per test, the greater the test's accuracy, but the longer it takes
to run. The default is 2 seconds, which allows the program to
complete in about 30 seconds.
to run. The default is 5 seconds, which allows the program to
complete in under 2 minutes.
</para>
</listitem>
</varlistentry>
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment