Received: from maia.hub.org (maia-1.hub.org [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 83BB0632CF4 for ; Mon, 10 May 2010 12:49:29 -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 94879-06 for ; Mon, 10 May 2010 15:49:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id F3F2B6335F1 for ; Mon, 10 May 2010 12:49:21 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id o4AFnFQ20734; Mon, 10 May 2010 11:49:15 -0400 (EDT) From: Bruce Momjian Message-Id: <201005101549.o4AFnFQ20734@momjian.us> Subject: Re: no universally correct setting for fsync In-Reply-To: To: Robert Haas Date: Mon, 10 May 2010 11:49:15 -0400 (EDT) CC: Michael Tharp , Craig Ringer , pgsql-hackers@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201005/469 X-Sequence-Number: 162132 Robert Haas wrote: > On Mon, May 10, 2010 at 11:12 AM, Bruce Momjian wrote: > > Michael Tharp wrote: > >> On 05/08/2010 04:07 AM, Craig Ringer wrote: > >> > It's probably worth mentioning that people who want to turn off fsync to > >> > gain a performance boost should instead look at a RAID controller with a > >> > BBU so they can safely enable write-back caching, getting most of the > >> > benefits of fsync=off safely. > >> > >> Which options specifically should be set if a BBU is in use? Obviously > >> fsync should be on always, but can full_page_writes be disabled? Are > >> there other tweaks that can be done? > >> > >> It would be great to see some practical hints in the documentation while > >> the fsync part is getting changed. > > > > Uh, our docs have: > > > > ? ? ? ?Turning this parameter off speeds normal operation, but might > > ? ? ? ?lead to a corrupt database after an operating system crash or > > ? ? ? ?power failure. The risks are similar to turning off > > ? ? ? ?fsync, though smaller. ?It might be safe to turn > > ? ? ? ?off this parameter if you have hardware (such as a battery-backed > > ? ? ? ?disk controller) or file-system software that reduces the risk > > ? ? ? ?of partial page writes to an acceptably low level (e.g., ZFS). > > "It might be safe" is a bit of a waffle. It would be nice if we could > provide some more clear guidance as to whether it is or is not, or how > someone could go about testing their hardware to find out. Agreed. It is "safe" for us to be definitive here? -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com