Re: mount -o async - is it safe? - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: mount -o async - is it safe?
Date
Msg-id 20060119095844.GE9949@svana.org
Whole thread Raw
In response to mount -o async - is it safe?  (Shane Wright <shane.wright@edigitalresearch.com>)
Responses Re: mount -o async - is it safe?  (Doug McNaught <doug@mcnaught.org>)
List pgsql-general
On Thu, Jan 19, 2006 at 09:42:59AM +0000, Shane Wright wrote:
> Now my question is this; the provider has, by default, mounted it with -o
> sync; so all reads/writes are synchronous.  This doesn't result in the
> greatest of performance, and indeed remounting -o async is significantly
> faster.
>
> They tell me this is so mySQL databases don't get corrupted in the event of
> a crash.  which is fine...
>
> But as Postgres uses fsync() to force committed transactions to disk, then
> this shouldn't be necessary, right?

That depends. As long as the data is appropriately sync()ed when
PostgreSQL asks, it should be fine. However, from reading the manpage
it's not clear if fsync() still works when mounted -o async.

If -o async means "all I/O is asyncronous except stuff explicitly
fsync()ed" you're fine. Otherwise...

The usual advice is to stick the WAL on a properly synced partition and
stick the rest somewhere else. Note, I have no experience with this,
it's just what I've heard.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Shane Wright
Date:
Subject: mount -o async - is it safe?
Next
From: Michelle Konzack
Date:
Subject: tsearch2 and "how to use"