Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TJCwx-0000X4-G7 for pgsql-docs@postgresql.org; Wed, 03 Oct 2012 00:36:31 +0000 Received: from mail-oa0-f46.google.com ([209.85.219.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TJCwv-0002Vd-N9 for pgsql-docs@postgresql.org; Wed, 03 Oct 2012 00:36:30 +0000 Received: by oagh16 with SMTP id h16so6865576oag.19 for ; Tue, 02 Oct 2012 17:36:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:x-gm-message-state; bh=cETX5LCiSqF5rQmmX4QBDriskJNkKVRq2ltK7cUOl6Y=; b=JG55CYUlQCsA+kr4O/QzgoKBZTlQkyTop0ItlxxNzgJG0cGKc2ANA10OUyYY+wz9TD Pf7dwIQLFhjkCPDKWexKvSQPmeJb7Bif00zZaFIoknNziHEQyDyT3iEG4ALw8Wh3z9mJ bXVCymfdhyh5N4RBqiDzyZQOU6L4mn9eeVngQGoGxPaRV0bx4/mJmVpGOWysWbgXnFpW JlgYrnHSNR8nKbu1LxTdUIs5Wl4hB8uW05rh52DNmja7rIiwY0ABNkUEw+K/ny+V8Ga0 jGSRc5Lk41+sZG75y3JRxprcmHCv3Bl6M2097ie5lyTltouQkBR++VSSLit9YMe+l99f Du8w== MIME-Version: 1.0 Received: by 10.60.32.136 with SMTP id j8mr370522oei.0.1349224588501; Tue, 02 Oct 2012 17:36:28 -0700 (PDT) Received: by 10.60.44.103 with HTTP; Tue, 2 Oct 2012 17:36:28 -0700 (PDT) Date: Tue, 2 Oct 2012 17:36:28 -0700 X-Google-Sender-Auth: mIhZ8aC7h48JjiipEvReFSOpehA Message-ID: Subject: Manual Entries of commit_delay and commit_siblings are not complete. From: Tianyin Xu To: pgsql-docs@postgresql.org Content-Type: multipart/alternative; boundary=e89a8fb1ffa251e3a104cb1cd49b X-Gm-Message-State: ALoCoQm+SRxKetTq7wAXEdn3alNU4VJbaOlUGaz/eDNybmPjOv7/uetg0MxtEqOhOVDTBdL2futg X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201210/1 X-Sequence-Number: 7481 --e89a8fb1ffa251e3a104cb1cd49b Content-Type: text/plain; charset=ISO-8859-1 Hi, pgsql-docs, I was confused by the system behavior of PG's write ahead log, specifically the relation between commit_delay, commit_siblings, and fsync. Basically according to the manual ( http://www.postgresql.org/docs/9.1/static/runtime-config-wal.html), I know: "commit_delay" specifies the delay before a transaction attempts to flush the WAL buffer out to disk. "commit_siblings" specifies minimum number of concurrent open transactions to require before performing the commit_delay delay. However, after looking at the code, I figured out these configuration parameters are also controlled by fsync. The only usage of the two parameter I can find is: /* src/backend/access/transam/xact.c */ static TransactionId RecordTransactionCommit(void) ... if (CommitDelay > 0 && enableFsync && MinimumActiveBackends(CommitSiblings)) pg_usleep(CommitDelay); ... } where, CommitDelay stores the parameter of "commit_delay", CommitSiblings stores the parameter of "commit_siblings", and enableFsync stores the parameter of "fsync". It seems the two parameters (commit_delay and commit_siblings) only have effect when fsync is set to be *on*. But, unfortunately, such behavior is not covered in the manual. The mistake I made is only set the two values but disabling fsync so the expected PG does not behave as I expected. I think it's definitely helpful to specify the relations between these configuration parameters either in the manual, or in the source code by giving warnings logs. Thanks a lot! Tianyin -- Tianyin XU, http://cseweb.ucsd.edu/~tixu/ --e89a8fb1ffa251e3a104cb1cd49b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, pgsql-docs,

I was confused by the system behavior of= PG's write ahead log, specifically the relation between=A0commit_delay,=A0commit_= siblings, and=A0fsync.

Basically according to the manual (http://www.postgr= esql.org/docs/9.1/static/runtime-config-wal.html), I know:

"commit_delay" = specifies=A0the delay= before a transaction attempts to flush the WAL buffer out to disk.<= /div>
"commit_siblings"=A0specifies minimum number of concurrent o= pen transactions to require before performing the=A0commit_delay=A0delay.

However, after looking at the= code, I figured out these configuration parameters are also controlled by= =A0fsync.

The= only usage of the two parameter I can find is:

/*=A0src/backend/access/t= ransam/xact.c=A0*/

static TransactionId
RecordTransactionCommit(void)
= =A0 =A0 =A0...
=A0 =A0 =A0if= (CommitDelay > 0 &&=A0
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 enableFsync &&
= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 MinimumActiveBackends(CommitSiblings))<= /div>
=A0 =A0 =A0 =A0 =A0 =A0 pg_usleep(CommitDelay);

=A0 =A0 ...
}

where, CommitDelay stores the parameter = of "commit_delay", CommitSiblings stores the p= arameter of "commit_siblings", and=A0enableFsy= nc=A0stores the parameter of "fsync".

It = seems the two parameters (commit_delay=A0and=A0commit_siblings) only have effect when=A0fsync= =A0is set to be *on*.

But= , unfortunately, such behavior is not covered in the manual. The mistake I = made is only set the two values but disabling=A0fsync=A0= so the expected PG does not behave as I expected. I think it's definite= ly helpful to specify the relations between these configuration parameters = either in the manual, or in the source code by giving warnings logs.

Tha= nks a lot!
Tianyin

= --e89a8fb1ffa251e3a104cb1cd49b--