Re: Proposed LogWriter Scheme, WAS: Potential Large

From: Greg Copeland <greg(at)CopelandConsulting(dot)Net>
To: Curtis Faith <curtis(at)galtair(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Pgsql-Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposed LogWriter Scheme, WAS: Potential Large
Date: 2002-10-06 16:06:38
Message-ID: 1033920399.14342.15.camel@mouse.copelandconsulting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 2002-10-05 at 14:46, Curtis Faith wrote:
>
> 2) aio_write vs. normal write.
>
> Since as you and others have pointed out aio_write and write are both
> asynchronous, the issue becomes one of whether or not the copies to the
> file system buffers happen synchronously or not.

Actually, I believe that write will be *mostly* asynchronous while
aio_write will always be asynchronous. In a buffer poor environment, I
believe write will degrade into a synchronous operation. In an ideal
situation, I think they will prove to be on par with one another with a
slight bias toward aio_write. In less than ideal situations where
buffer space is at a premium, I think aio_write will get the leg up.

>
> The kernel doesn't need to know anything about platter rotation. It
> just needs to keep the disk write buffers full enough not to cause
> a rotational latency.

Which is why in a buffer poor environment, aio_write is generally
preferred as the write is still queued even if the buffer is full. That
means it will be ready to begin placing writes into the buffer, all
without the process having to wait. On the other hand, when using write,
the process must wait.

In a worse case scenario, it seems that aio_write does get a win.

I personally would at least like to see an aio implementation and would
be willing to even help benchmark it to benchmark/validate any returns
in performance. Surely if testing reflected a performance boost it
would be considered for baseline inclusion?

Greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-10-06 16:46:14 Re: Proposed LogWriter Scheme, WAS: Potential Large
Previous Message Curt Sampson 2002-10-06 15:52:24 Re: [HACKERS] Performance while loading data and indexing