X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id E1983D1B8B4 for ; Thu, 4 Sep 2003 03:36:24 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 83402-08 for ; Thu, 4 Sep 2003 00:36:14 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id B279AD1B56B for ; Thu, 4 Sep 2003 00:36:13 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id B1D2E1025B; Wed, 3 Sep 2003 23:28:07 -0400 (EDT) Received: from [192.168.1.200] (dyn-133-83.tor.dsl.tht.net [134.22.133.83]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 7F8D510248; Wed, 3 Sep 2003 23:28:05 -0400 (EDT) Subject: Re: PostgreSQL Reliability when fsync = false on Linux-XFS From: Rod Taylor To: Federico Sevilla III Cc: PostgreSQL Performance Mailing List , Linux-XFS Mailing List In-Reply-To: <20030904030404.GA32319@leathercollection.ph> References: <20030904030404.GA32319@leathercollection.ph> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-ZUA7x1WEMI42NEQ8G5Oh" Message-Id: <1062646595.84923.35.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 03 Sep 2003 23:36:36 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/48 X-Sequence-Number: 3414 --=-ZUA7x1WEMI42NEQ8G5Oh Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > - the way PostgreSQL expects data to be written to disk without the > fsync calls for things not to get corrupted in the event of a crash, > and If you want the filesystem to deal with this, I believe it is necessary for it to write the data out in the same order the write requests are supplied in between ALL PostgreSQL processes. If you can accomplish this, you do not need WAL. There are shortcuts which can be taken in the above, which is where WAL comes in. WAL writes are ordered between processes and WAL of a single process always hits disk prior to commit -- fsync forces both of these. Due to WAL being in place, data can be written at almost any time. The benefit to WAL is a single file fsync rather than the entire database requiring one (PostgreSQL pre-7.1 method). > I know that at the end of the day, if I value my data, I must (1) back > it up regularly, and (2) keep fsync enabled in PostgreSQL. However given > the significance performance hit (at least as far as massive INSERT or If you want good performance, invest in a SCSI controller that has battery backed write cache. A few megs will do it. You will find performance similar to fsync being off (you don't wait for disk rotation) but without the whole dataloss issue. Another alternative is to buy a small 15krpm disk dedicated for WAL. In theory you can achieve one commit per rotation. I assume your inserts are not supplied in Bulk. The fsync overhead is per transaction, not per insert. --=-ZUA7x1WEMI42NEQ8G5Oh Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQA/VrNC6DETLow6vwwRAsKhAJ9cqzW44fD1U+hrIQ4/fLZKhP/onQCfXpp6 c1wPATybuPvCvYC+zsgJiZc= =fphL -----END PGP SIGNATURE----- --=-ZUA7x1WEMI42NEQ8G5Oh--