From: Ravi Krishna <s.ravikrishna@aim.com>
To: pgsql-admin@postgresql.org
Subject: WAL and O_DIRECT
Date: Thu, 14 May 2015 11:03:11 -0400
Message-ID: <14d52f362c9-2108-309cd@webstg-m03.mail.aol.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
As per PG 9.4 documentation:
wal_sync_method (enum)
Method used for forcing WAL updates out to disk. If fsync is off then this setting is irrelevant, since WAL file updates will not be forced out at all. Possible values are:
open_datasync (write WAL files with open() option O_DSYNC)
fdatasync (call fdatasync() at each commit)
fsync (call fsync() at each commit)
fsync_writethrough (call fsync() at each commit, forcing write-through of any disk write cache)
open_sync (write WAL files with open() option O_SYNC)
The open_* options also use O_DIRECT if available. Not all of these choices are available on all platforms. The default is the first method in the above list that is supported by the platform, except that fdatasync is the default on Linux. The default is not necessarily ideal; it might be necessary to change this setting or other aspects of your system configuration in order to create a crash-safe configuration or achieve optimal performance. These aspects are discussed in Section 29.1. This parameter can only be set in the postgresql.conf file or on the server command line.
===============
Our wal_sync_metho is opn_sync.
In RHEL 6.4, strace command shows PG opening the WAL files in the following mode
1431610784.573828 open("pg_xlog/0000000100000047000000A5", O_RDWR|O_DSYNC)
Why is O_DIRECT not used, despite the documentation mentioning otherwise?
On the same host, DB2 opens active logs (WAL) as follows
open("/bb/db/pgentdb/data001/db2/db2/NODE0000/SQL00001/LOGSTREAM0000/S0000001.LOG", O_RDWR|O_DSYNC|O_DIRECT)
We were expecting the same in PG too.
We are bench-marking PG vs DB2 for a new app.
Thanks.
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: s.ravikrishna@aim.com
Subject: Re: WAL and O_DIRECT
In-Reply-To: <14d52f362c9-2108-309cd@webstg-m03.mail.aol.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox