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 F23D911F6474 for ; Fri, 28 Apr 2006 01:57:07 -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 28866-09 for ; Fri, 28 Apr 2006 01:56:54 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 44C7911F647F for ; Fri, 28 Apr 2006 01:56:53 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k3S4um0G025292; Fri, 28 Apr 2006 00:56:49 -0400 (EDT) To: guoping.zhang@nec.com.au cc: pgsql-performance@postgresql.org, "'Guoping Zhang (E-mail)'" Subject: Re: how unsafe (or worst scenarios) when setting fsync OFF for postgresql In-reply-to: <004101c66a7e$4ab95000$74304c93@eddy> References: <004101c66a7e$4ab95000$74304c93@eddy> Comments: In-reply-to "Guoping Zhang" message dated "Fri, 28 Apr 2006 14:43:26 +1000" Date: Fri, 28 Apr 2006 00:56:48 -0400 Message-ID: <25291.1146200208@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/659 X-Sequence-Number: 18743 "Guoping Zhang" writes: > a) The tests consists of ten thousands very small transactions, which are > not grouped, that is why so slow with compare to set fsync off. Yup. > c) wal_sync_method is set to 'open_datasync', which is fastest among the > four, right? Well, is it? You shouldn't assume that without testing. > Looks like, if we have to set fsync be true, we need to modify our > application. Yes, you should definitely look into batching your operations into larger transactions. On normal hardware you can't expect to commit transactions faster than one per disk revolution (unless they're coming from multiple clients, where there's a hope of ganging several parallel commits per revolution). Or buy a disk controller with battery-backed write cache and put your faith in that cache surviving a machine crash. But don't turn off fsync if you care about your data. regards, tom lane