Increase the default for wal_sender_delay from 200ms to 1s. Now that WAL

sender is immediately woken up by transaction commit, there's no need to
wake up so aggressively.
This commit is contained in:
Heikki Linnakangas 2011-02-26 23:36:24 +02:00
parent 42e5223648
commit be6668d6ef
4 changed files with 8 additions and 5 deletions

View File

@ -1939,8 +1939,11 @@ SET ENABLE_SEQSCAN TO OFF;
Specifies the delay between activity rounds for WAL sender processes.
In each round the WAL sender sends any WAL accumulated since the last
round to the standby server. It then sleeps for
<varname>wal_sender_delay</> milliseconds, and repeats. The default
value is 200 milliseconds (<literal>200ms</>).
<varname>wal_sender_delay</> milliseconds, and repeats. The sleep
is interrupted by transaction commit, so the effects of a committed
transaction are sent to standby servers as soon as the commit
happens, regardless of this setting. The default value is one second
(<literal>1s</>).
Note that on many systems, the effective resolution of sleep delays is
10 milliseconds; setting <varname>wal_sender_delay</> to a value that
is not a multiple of 10 might have the same results as setting it to

View File

@ -73,7 +73,7 @@ bool am_walsender = false; /* Am I a walsender process ? */
/* User-settable parameters for walsender */
int max_wal_senders = 0; /* the maximum number of concurrent walsenders */
int WalSndDelay = 200; /* max sleep time between some actions */
int WalSndDelay = 1000; /* max sleep time between some actions */
/*
* These variables are used similarly to openLogFile/Id/Seg/Off,

View File

@ -1843,7 +1843,7 @@ static struct config_int ConfigureNamesInt[] =
GUC_UNIT_MS
},
&WalSndDelay,
200, 1, 10000, NULL, NULL
1000, 1, 10000, NULL, NULL
},
{

View File

@ -188,7 +188,7 @@
#max_wal_senders = 0 # max number of walsender processes
# (change requires restart)
#wal_sender_delay = 200ms # walsender cycle time, 1-10000 milliseconds
#wal_sender_delay = 1s # walsender cycle time, 1-10000 milliseconds
#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed