Re: Use of sync() [was Re: Potential Large Performance Gain in WAL synching]

From: Doug McNaught <doug(at)wireboard(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mats Lofkvist <mal(at)algonet(dot)se>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Use of sync() [was Re: Potential Large Performance Gain in WAL synching]
Date: 2002-10-05 16:29:33
Message-ID: m34rc0onma.fsf@varsoon.wireboard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> In practice I am not sure there is a problem. The local man page for
> sync() says
>
> The writing, although scheduled, is not necessarily complete upon
> return from sync.
>
> Now if "scheduled" means "will occur before any subsequently-commanded
> write occurs" then we're fine. I don't know if that's true though ...

In my understanding, it means "all currently dirty blocks in the file
cache are queued to the disk driver". The queued writes will
eventually complete, but not necessarily before sync() returns. I
don't think subsequent write()s will block, unless the system is low
on buffers and has to wait until dirty blocks are freed by the driver.

-Doug

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Curtis Faith 2002-10-05 16:33:14 Re: Proposed LogWriter Scheme, WAS: Potential Large Performance Gain in WAL synching
Previous Message Tom Lane 2002-10-05 16:07:37 Re: Use of sync() [was Re: Potential Large Performance Gain in WAL synching]