X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id A68E711F6475 for ; Fri, 28 Apr 2006 02:01:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 46031-08 for ; Fri, 28 Apr 2006 02:01:21 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from ns2.nec.com.au (ns2.nec.com.au [147.76.180.2]) by postgresql.org (Postfix) with ESMTP id C45DC11F6251 for ; Fri, 28 Apr 2006 02:01:20 -0300 (ADT) Received: from ns2.nec.com.au ([127.0.0.1]) by localhost (ns2.nec.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 30410-01-89 for ; Fri, 28 Apr 2006 15:01:19 +1000 (EST) Received: from smtp1.nec.com.au (unknown [172.31.8.18]) by ns2.nec.com.au (Postfix) with ESMTP id CBBCA3B6E7 for ; Fri, 28 Apr 2006 15:01:19 +1000 (EST) Received: from eddy (eddy.ssd.neca.nec.com.au [147.76.48.116]) by warp.ssd.neca.nec.com.au (8.12.10+Sun/8.12.10) with SMTP id k3S51IuP026592; Fri, 28 Apr 2006 15:01:18 +1000 (EST) Reply-To: From: "Guoping Zhang" To: "'Tom Lane'" , "'Simon Riggs'" Cc: , "'Guoping Zhang (E-mail)'" Subject: Re: how unsafe (or worst scenarios) when setting fsync Date: Fri, 28 Apr 2006 15:01:17 +1000 Message-ID: <004201c66a80$c8f86d00$74304c93@eddy> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <11142.1146149866@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/660 X-Sequence-Number: 18744 Hi, Simon/tom, Thanks for the reply. It appears to me that we have to set fsync ON, as a badly corrupted database by any chance in production line will lead a serious problem. However, when try the differnt 'wal_sync_method' setting, lead a quite different operation time (open_datasync is best for speed). But altering the commit_delay from 1 to 100000, I observed that there is no time difference for the operation. Why is that? As our tests consists of 10000 small transactions which completed in 66 seconds, that is, about 160 transactions per second. When commit_delay set to 100000 (i.e., 0.1 second), that in theory, shall group around 16 transactions into one commit, but result is same from the repeated test. Am I mistaken something here? Cheers and Regards, Guoping -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: 2006Äê4ÔÂ28ÈÕ 0:58 To: Simon Riggs Cc: guoping.zhang@nec.com.au; pgsql-performance@postgresql.org; Guoping Zhang (E-mail) Subject: Re: [PERFORM] how unsafe (or worst scenarios) when setting fsync Simon Riggs writes: > On Thu, 2006-04-27 at 16:31 +1000, Guoping Zhang wrote: >> Can we set fsync OFF for the performance benefit, have the risk of only 5 >> minutes data loss or much worse? > Thats up to you. > fsync can be turned on and off, so you can make critical changes with > fsync on, then continue with fsync off. I think it would be a mistake to assume that the behavior would be nice clean "we only lost recent changes". Things could get arbitrarily badly corrupted if some writes make it to disk and some don't. regards, tom lane