pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Martijn van Oosterhout <kleptog@svana.org>
Cc: Benjamin Arai <barai@cs.ucr.edu>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Running with fsync=off
Date: Thu, 22 Dec 2005 11:47:13 -0500
Message-ID: <23560.1135270033@sss.pgh.pa.us> (raw)
In-Reply-To: <20051222080759.GB21783@svana.org>
References: <43AA5607.20000@cs.ucr.edu>
	<20051222080759.GB21783@svana.org>

Martijn van Oosterhout <kleptog@svana.org> 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 sync<RETURN>sync<RETURN> 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



view thread (7+ messages)  latest in thread

Message-ID: <23560.1135270033@sss.pgh.pa.us>
Permalink:  ../23560.1135270033@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23560.1135270033@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, kleptog@svana.org, barai@cs.ucr.edu, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] Running with fsync=off
  In-Reply-To: <23560.1135270033@sss.pgh.pa.us>
  References: <43AA5607.20000@cs.ucr.edu> <20051222080759.GB21783@svana.org> <23560.1135270033@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox