Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] Running with fsync=off

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>,Benjamin Arai <barai(at)cs(dot)ucr(dot)edu>, pgsql-admin(at)postgresql(dot)org,pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Running with fsync=off
Date: 2005-12-27 21:12:38
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-adminpgsql-general
On Thu, Dec 22, 2005 at 11:47:13AM -0500, Tom Lane wrote:
> Martijn van Oosterhout <kleptog(at)svana(dot)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.

How would sync<RETURN>sync<RETURN> 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(at)pervasive(dot)com
Pervasive Software    work: 512-231-6117
vcard:       cell: 512-569-9461

In response to


pgsql-admin by date

Next:From: Tom ArthursDate: 2005-12-27 21:15:39
Subject: Re: Pgstat.tmp file activity
Previous:From: Jim C. NasbyDate: 2005-12-27 21:08:44
Subject: Re: Pgstat.tmp file activity

pgsql-general by date

Next:From: EugeneDate: 2005-12-27 21:25:37
Subject: POSTGRES DB 3 800 000 rows table, speed up?
Previous:From: Joshua D. DrakeDate: 2005-12-27 20:56:21
Subject: Re: EXPLAIN ANALYZE output

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group