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

Re: extremly low memory usage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Stone <mstone+postgres(at)mathom(dot)us>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: extremly low memory usage
Date: 2005-08-20 14:40:41
Message-ID: 23044.1124548841@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Michael Stone <mstone+postgres(at)mathom(dot)us> writes:
> On Sat, Aug 20, 2005 at 02:17:54PM +0300, Marko Ristola wrote:
>> Based on my knoledge, Ext3 is good with keeping filesystem integrity
>> AND data integrity while pressing the reset button.  However, by
>> selecting data=writeback, you gain more speed, but you risk the data
>> integrity during a crash: Ext3 garantees only filesystem integrity.

> That's why postgres keeps its own transaction log. Any of these
> filesystems guarantee data integrity for data that's been synced to
> disk, and postgres keeps track of what data has and has not been
> committed so it can recover gracefully from a failure.

Right.  I think the optimal setting for a Postgres data directory is
journaled metadata, non-journaled file content.  Postgres can take care
of the data integrity for itself, but it does assume that the filesystem
stays structurally sane (eg, data blocks don't get reassigned to the
wrong file), so you need a filesystem guarantee about the metadata.

WAL files are handled in a much more conservative way (created, filled
with zeroes, and fsync'd before we ever put any valuable data in 'em).
If you have WAL on its own drive then I think Mike's recommendation of
no filesystem journalling at all for that drive is probably OK.  Or
you can do same as above (journal metadata only) if you want a little
extra protection.

And of course all this reasoning depends on the assumption that the
drive tells the truth about write-completion.  If the drive does write
caching it had better be able to complete all its accepted writes before
dying in a power failure.  (Hence, battery-backed write cache is OK, any
other kind is evil.)

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Steinar H. GundersonDate: 2005-08-20 15:10:25
Subject: Re: index as large as table
Previous:From: Gavin SherryDate: 2005-08-20 13:08:13
Subject: Re: index as large as table

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