Re: Potential Large Performance Gain in WAL synching - Mailing list pgsql-hackers

From Neil Conway
Subject Re: Potential Large Performance Gain in WAL synching
Date
Msg-id 873crlajs0.fsf@mailbox.samurai.com
Whole thread Raw
In response to Re: Potential Large Performance Gain in WAL synching  ("Curtis Faith" <curtis@galtair.com>)
Responses Re: Potential Large Performance Gain in WAL synching  (Greg Copeland <greg@CopelandConsulting.Net>)
Re: Potential Large Performance Gain in WAL synching  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Curtis Faith" <curtis@galtair.com> writes:
> It looks to me like BufferAlloc will simply result in a call to
> BufferReplace > smgrblindwrt > write for md storage manager objects.
> 
> This means that a process will block while the write of dirty cache
> buffers takes place.

I think Tom was suggesting that when a buffer is written out, the
write() call only pushes the data down into the filesystem's buffer --
which is free to then write the actual blocks to disk whenever it
chooses to. In other words, the write() returns, the backend process
can continue with what it was doing, and at some later time the blocks
that we flushed from the Postgres buffer will actually be written to
disk. So in some sense of the word, that I/O is asynchronous.

Cheers,

Neil

-- 
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: ALTER TABLE ... ADD COLUMN
Next
From: Giles Lean
Date:
Subject: Re: Improving backend startup interlock