X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id D337B9DCC4D for ; Thu, 22 Dec 2005 12:47:16 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13782-09 for ; Thu, 22 Dec 2005 12:47:15 -0400 (AST) 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 D73959DC844 for ; Thu, 22 Dec 2005 12:47:13 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id jBMGlDbo023561; Thu, 22 Dec 2005 11:47:13 -0500 (EST) To: Martijn van Oosterhout cc: Benjamin Arai , pgsql-admin@postgresql.org, pgsql-general@postgresql.org Subject: Re: [GENERAL] Running with fsync=off In-reply-to: <20051222080759.GB21783@svana.org> References: <43AA5607.20000@cs.ucr.edu> <20051222080759.GB21783@svana.org> Comments: In-reply-to Martijn van Oosterhout message dated "Thu, 22 Dec 2005 09:08:07 +0100" Date: Thu, 22 Dec 2005 11:47:13 -0500 Message-ID: <23560.1135270033@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.033 required=5 tests=[AWL=0.033] X-Spam-Score: 0.033 X-Spam-Level: X-Archive-Number: 200512/275 X-Sequence-Number: 19995 Martijn van Oosterhout writes: > On Wed, Dec 21, 2005 at 11:30:15PM -0800, Benjamin Arai wrote: >> Somebody said running "sync ; sync; sync" from the console. This seems > The reason is partly historical. On some OSes running sync only starts > the process but returns immediatly. However, there can only be one sync > at a time so the second sync waits for the first the finish. The third > is just for show. However, on Linux at least the one sync is enough. No, the second and third are both a waste of time. sync tells the kernel to flush any dirty buffers to disk, but doesn't wait for it to happen. There is a story that the advice to type sync twice was originally given to operators of an early Unix system, as a quick-and-dirty way of making sure that they didn't power the machine down before the sync completed. I don't know if it's true or not, but certainly the value would only appear if you type syncsync so that the first sync is actually issued before you type the next one. Typing them all on one line as depicted is just a waste of finger motion. regards, tom lane