Skip site navigation (1) Skip section navigation (2)

Re: Streaming replication on win32, still broken

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Streaming replication on win32, still broken
Date: 2010-02-18 12:46:46
Message-ID: 4B7D36B6.7030903@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Magnus Hagander wrote:
> 2010/2/18 Fujii Masao <masao(dot)fujii(at)gmail(dot)com>:
>> On Thu, Feb 18, 2010 at 7:04 PM, Heikki Linnakangas
>> <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>>> Magnus Hagander wrote:
>>>> O_DIRECT helps us when we're not going to read the file again, because
>>>> we don't waste cache on it. If we are, which is the case here, it
>>>> should be really bad for performance, since we actually have to do a
>>>> physical read.
>>>>
>>>> Incidentally, that should also apply to general WAL when archive_mdoe
>>>> is on. Do we optimize for that?
>>> Hmm, no we don't. We do take that into account so that we refrain from
>>> issuing posix_fadvice(DONTNEED) if archive_mode is on, but we don't
>>> disable O_DIRECT. Maybe we should..
>> Since the performance of WAL write is more important than that of WAL
>> archiving in general, that optimization might offer little benefit.
> 
> Well, it's going to make the process that reads the WAL cause actual
> physical I/O... That'll take a chunk out of your total available I/O,
> which is likely to push you to the limit of your I/O capacity much
> quicker.

Right, doesn't seem sensible, though it would be nice to see a benchmark
on that.

Here's a patch to disable O_DIRECT when archiving or streaming is
enabled. This is pretty hard to test, so any extra eyeballs would be nice..

-- 
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

Attachment: no-O_DIRECT-with-archiving-1.patch
Description: text/x-diff (15.3 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2010-02-18 14:09:45
Subject: Re: remove contrib/xml2
Previous:From: Heikki LinnakangasDate: 2010-02-18 12:23:17
Subject: Re: [COMMITTERS] pgsql: Introduce WAL records to log reuse of btree pages, allowing

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group