Re: O_DIRECT support for Windows

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org, Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: O_DIRECT support for Windows
Date: 2007-03-28 05:47:12
Message-ID: 20070328141319.63D7.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Magnus Hagander <magnus(at)hagander(dot)net> wrote:

> IIRC, we're still waiting for performance numbers showing there exists a
> win from this patch.

Here is a performance number of Direct I/O support on Windows.
There was 10%+ of performance win on pgbench (263.33 vs. 290.79) in O_DIRECT.

However, I only have a desktop-class machine for Windows.
(Pendium 4 3.6GHz with HT, 3GB of RAM, 2 ATA-drives)
Test on production-class machines might show different results.

In addition, I'm slightly worried about aligment issues reported by Magnus.
We might need fail-back-to-non-direct feature on error for safety.

$ pgbench -i -s50
$ pgbench -s50 -t8000 -c8

O_DSYNC (FILE_FLAG_WRITE_THROUGH)
263.33 tps
O_DSYNC + O_DIRECT (FILE_FLAG_WRITE_THROUGH + NO_BUFFERING)
290.79 tps

wal_sync_method = open_datasync
wal_buffers = 4MB
shared_buffers = 256MB
checkpoint_segments = 64

> > Magnus Hagander wrote:
> >> We're ok with the alignment issues provided the is code added to reject
> >> O_DIRECT if the sector size is too large.

> >>> ITAGAKI Takahiro wrote:
> >>>> The attached is a patch to define O_DIRECT by ourselves on Windows,
> >>>> and to map O_DIRECT to FILE_FLAG_NO_BUFFERING.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew - Supernews 2007-03-28 07:05:24 Re: Arrays of Complex Types
Previous Message Tom Lane 2007-03-28 03:12:56 Re: pg_index updates and SI invalidation

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew - Supernews 2007-03-28 07:05:24 Re: Arrays of Complex Types
Previous Message Koichi Suzuki 2007-03-28 01:54:11 Re: [PATCHES] Full page writes improvement, code update