Re: Background writer process

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Shridhar Daithankar <shridhar_daithankar(at)myrealbox(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Background writer process
Date: 2003-11-14 17:29:09
Message-ID: 200311141729.hAEHT9l29133@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Shridhar Daithankar wrote:
> On Friday 14 November 2003 03:05, Jan Wieck wrote:
> > For sure the sync() needs to be replaced by the discussed fsync() of
> > recently written files. And I think the algorithm how much and how often
> > to flush can be significantly improved. But after all, this does not
> > change the real checkpointing at all, and the general framework having a
> > separate process is what we probably want.
>
> Having fsync for regular data files and sync for WAL segment a comfortable
> compramise? Or this is going to use fsync for all of them.

I think we still need sync() for WAL because sometimes backends are
going to have to write their own buffers, and we don't want them using
fsync or it will be very slow.

> IMO, with fsync, we tell kernel that you can write this buffer. It may or may
> not write it immediately, unless it is hard sync.
>
> Since postgresql can afford lazy writes for data files, I think this could
> work.

fsync() doesn't return until the data is on the disk. It doesn't
schedule the write then return, as far as I know. sync() does schedule
the writes, I think, which can be bad, but we delay a little to wait for
it to complete.

--
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-11-14 17:35:08 Re: [HACKERS] heads up -- subtle change of behavior of new
Previous Message Hannu Krosing 2003-11-14 17:28:45 Re: ALTER TABLE modifications