Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 967DE632DAC for ; Thu, 25 Mar 2010 15:20:12 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 52354-08 for ; Thu, 25 Mar 2010 18:19:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from 27.mail-out.ovh.net (27.mail-out.ovh.net [91.121.30.210]) by mail.postgresql.org (Postfix) with SMTP id 6CF1D632517 for ; Thu, 25 Mar 2010 15:20:01 -0300 (ADT) Received: (qmail 12290 invoked by uid 503); 25 Mar 2010 18:23:36 -0000 Received: from b6.ovh.net (HELO mail624.ha.ovh.net) (213.186.33.56) by 27.mail-out.ovh.net with SMTP; 25 Mar 2010 18:23:36 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 25 Mar 2010 18:19:58 -0000 Received: from par69-8-88-161-102-87.fbx.proxad.net (HELO localhost) (lists%peufeu.com@88.161.102.87) by ns0.ovh.net with SMTP; 25 Mar 2010 18:19:58 -0000 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Jaime Casanova" , "Tadipathri Raghu" Cc: pgsql-performance@postgresql.org Subject: Re: Why Wal_buffer is 64KB References: <645d9d71003250801o246439a0j93c7b568786e98de@mail.gmail.com> <3073cc9b1003251015x590e962ata59dadbb58b42ce5@mail.gmail.com> Date: Thu, 25 Mar 2010 19:14:38 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Pierre C" Message-ID: In-Reply-To: <3073cc9b1003251015x590e962ata59dadbb58b42ce5@mail.gmail.com> User-Agent: Opera Mail/10.10 (Linux) X-Ovh-Tracer-Id: 12199688441238652452 X-Ovh-Remote: 88.161.102.87 (par69-8-88-161-102-87.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|U 0.5/N X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.108 tagged_above=-10 required=5 tests=AWL=-1.109, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201003/321 X-Sequence-Number: 38146 If you do large transactions, which emits large quantities of xlog, be aware that while the previous xlog segment is being fsynced, no new writes happen to the next segment. If you use large wal_buffers (more than 16 MB) these buffers can absorb xlog data while the previous segment is being fsynced, which allows a higher throughput. However, large wal_buffers also mean the COMMIT of small transactions might find lots of data in the buffers that noone has written/synced yet, which isn't good. If you use dedicated spindle(s) for the xlog, you can set the walwriter to be extremely aggressive (write every 5 ms for instance) and use fdatasync. This way, at almost every rotation of the disk, xlog gets written. I've found this configuration gives increased throughput, while not compromising latency, but you need to test it for yourself, it depends on your whole system.