X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 71EBE329D30 for ; Mon, 20 Sep 2004 08:57:43 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 36399-03 for ; Mon, 20 Sep 2004 07:57:37 +0000 (GMT) Received: from mail.esphion.com (mail.esphion.com [202.6.75.178]) by svr1.postgresql.org (Postfix) with ESMTP id 41D54329E85 for ; Mon, 20 Sep 2004 08:57:37 +0100 (BST) Received: (qmail 16741 invoked from network); 20 Sep 2004 07:57:02 -0000 Received: from unknown (HELO conker.?none?) (10.0.1.137) by mail.esphion.com with SMTP; 20 Sep 2004 07:57:02 -0000 Received: (nullmailer pid 15617 invoked by uid 10001); Mon, 20 Sep 2004 07:57:34 -0000 Date: Mon, 20 Sep 2004 19:57:34 +1200 From: Guy Thornley To: pgsql-performance@postgresql.org Subject: O_DIRECT setting Message-ID: <20040920075734.GK21733@conker.esphion.com> Reply-To: Guy Thornley Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/203 X-Sequence-Number: 8331 A recent comment on this (or perhaps another?) mailing list about Sun boxen and the directio mount option has prompted me to read about O_DIRECT on the open() manpage. Has anybody tried this option? Ever taken any performance measurements? I assume the way postgres manages its buffer memory (dealing with 8kB pages) would be compatible with the restrictions: Under Linux 2.4 transfer sizes, and the alignment of user buffer and file offset must all be multiples of the logical block size of the file system. According to the manpage, O_DIRECT implies O_SYNC: File I/O is done directly to/from user space buffers. The I/O is synchronous, i.e., at the completion of the read(2) or write(2) system call, data is guaranteed to have been transferred. At the moment I am fairly interested in trying this, and I would spend some time with it, but I have my hands full with other projects. I'd imagine this is more use with the revamped buffer manager in PG8.0 than the 7.x line, but we are not using PG8.0 here yet. Would people be interested in a performance benchmark? I need some benchmark tips :) Incidentally, postgres heap files suffer really, really bad fragmentation, which affects sequential scan operations (VACUUM, ANALYZE, REINDEX ...) quite drastically. We have in-house patches that somewhat alleiviate this, but they are not release quality. Has anybody else suffered this? Guy Thornley