Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jul 2003 13:16:45 -0700
From:      Sean Chittenden <sean@chittenden.org>
To:        "Jim C. Nasby" <jim@nasby.net>
Cc:        Jason Stone <freebsd-performance@dfmm.org>
Subject:   Re: Tuning for PostGreSQL Database
Message-ID:  <20030721201645.GD61464@perrin.int.nxad.com>
In-Reply-To: <20030721194519.GE55392@nasby.net>
References:  <Pine.BSF.4.05.10307191344080.16986-100000@misery.sdf.com> <20030721043501.F14379-100000@walter> <20030721192645.GB61464@perrin.int.nxad.com> <20030721194519.GE55392@nasby.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> > > > Softupdates on, async off.  Softupdates is just a better
> > > > async.
> > > 
> > > postgresql fsync's all its files before returning from a commit
> > > in order to ensure durability, right?  Does softupdates
> > > interfere with the functioning of sync(2)/fsync(2)?
> > 
> > It can, yes, but that's the risk of soft updates.  From tuning(7):
> > 
> >      Softupdates drastically improves meta-data performance,
> >      mainly file creation and deletion.  We recommend enabling
> >      softupdates on most file systems; however, there are two
> >      limitations to softupdates that you should be aware of when
> >      determining whether to use it on a file system.  First,
> >      softupdates guarantees file system consistency in the case of
> >      a crash but could very easily be several seconds (even a
> >      minute!) behind on pending write to the physical disk.  If
> >      you crash you may lose more work than otherwise.  Secondly,
> >      softupdates delays the freeing of file system blocks.  If you
> >      have a file system (such as the root file system) which is
> >      close to full, doing a major update of it, e.g. ``make
> >      installworld'', can run it out of space and cause the update
> >      to fail.  For this reason, softupdates will not be enabled on
> >      the root file system during a typical install.
>  
> So are you saying that softupdates on whatever partition contains
> the database transaction logs is dangerous?

Well, think about it.  What happens when you pull the plug while the
OS is sitting on a pile of data that it's waiting to flush to disk?
The problem isn't so much with the WAL logs, so much as it is with the
actual files that contain the databases/table's data.  Any kind of
volatle backed buffer increases the danger of data loss.

Good solution for these concerns?  Get a UPS.

> Luckily, the metadata for these files is changed very infrequently
> (normally), so this shouldn't prove to be much of a performance
> impact.

Correct.

-sc

-- 
Sean Chittenden



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030721201645.GD61464>