From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Kurt Roeckx <Q(at)ping(dot)be> |
Cc: | Jan Wieck <JanWieck(at)Yahoo(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Background writer process |
Date: | 2003-11-14 00:16:53 |
Message-ID: | 200311140016.hAE0Gr708195@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Kurt Roeckx wrote:
> On Thu, Nov 13, 2003 at 05:39:32PM -0500, Bruce Momjian wrote:
> > Jan Wieck wrote:
> > > Bruce Momjian wrote:
> > > > He found that write() itself didn't encourage the kernel to write the
> > > > buffers to disk fast enough. I think the final solution will be to use
> > > > fsync or O_SYNC.
> > >
> > > write() alone doesn't encourage the kernel to do any physical IO at all.
> > > As long as you have enough OS buffers, it does happy write caching until
> > > you checkpoint and sync(), and then the system freezes.
> >
> > That's not completely true. Some kernels with trickle sync, meaning
> > they sync a little bit regularly rather than all at once so write() does
> > help get those shared buffers into the kernel for possible writing.
> > Also, it is possible the kernel will issue a sync() on its own.
>
> So basicly on some kernels you want them to flush their dirty
> buffers faster.
>
> I have a feeling we should more make it depend on the system how
> we ask them not to keep it in memory too long and that maybe the
> sync(), fsync() or O_SYNC could be a fallback in case it's needed
> and there are no better ways of doing it.
I think the final plan is to have a GUC variable that controls how the
kernel is _encouraged_ to write dirty buffers to disk.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2003-11-14 00:18:43 | Re: Background writer process |
Previous Message | Jan Wieck | 2003-11-14 00:11:44 | Re: cvs head? initdb? |