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 7ED509DCA07; Tue, 27 Dec 2005 17:12:39 -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 90512-03; Tue, 27 Dec 2005 17:12:40 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from flake.decibel.org (unknown [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id F26749DC993; Tue, 27 Dec 2005 17:12:36 -0400 (AST) Received: by flake.decibel.org (Postfix, from userid 1001) id 7757439834; Tue, 27 Dec 2005 15:12:38 -0600 (CST) Date: Tue, 27 Dec 2005 15:12:38 -0600 From: "Jim C. Nasby" To: Tom Lane Cc: Martijn van Oosterhout , Benjamin Arai , pgsql-admin@postgresql.org, pgsql-general@postgresql.org Subject: Re: [GENERAL] Running with fsync=off Message-ID: <20051227211238.GQ72143@pervasive.com> References: <43AA5607.20000@cs.ucr.edu> <20051222080759.GB21783@svana.org> <23560.1135270033@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23560.1135270033@sss.pgh.pa.us> X-Operating-System: FreeBSD 6.0-RELEASE amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.061 required=5 tests=[AWL=0.061] X-Spam-Score: 0.061 X-Spam-Level: X-Archive-Number: 200512/327 X-Sequence-Number: 20047 On Thu, Dec 22, 2005 at 11:47:13AM -0500, Tom Lane wrote: > 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. How would syncsync differ from sync;sync? The second case will wait for the first command to return, or is there a race condition that's reduced by typing by hand? -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461