pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Best setting for wal_sync_method
3+ messages / 2 participants
[nested] [flat]

* Best setting for wal_sync_method
@ 2015-05-07 13:36  Ravi Krishna <srkrishna@outlook.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Ravi Krishna @ 2015-05-07 13:36 UTC (permalink / raw)
  To: pgsql-admin

On RHEL 6.4 which is the best setting for wal_sync_method for write intensive operations. Is the default fdatasync good for all conditions, including reliability. 

Thanks 		 	   		  =

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Best setting for wal_sync_method
@ 2015-05-07 16:19  Ravi Krishna <srkrishna@outlook.com>
  parent: Ravi Krishna <srkrishna@outlook.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Ravi Krishna @ 2015-05-07 16:19 UTC (permalink / raw)
  To: pgsql-admin

Speaking to the sys admins we found that the file system where the WAL was written to did not have direct_io and hence all writes were getting buffered. So we enabled direct_io on that FS and now writes are order of magnitude slower (5x times). 

It seems PG already uses O_DIRECT for WAL. So is the enabling of direct_io in the mount options of the FS totally redundant. It definitely has a serious performance impact.

Thanks

From: srkrishna@outlook.com
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Best setting for wal_sync_method
Date: Thu, 7 May 2015 09:36:36 -0400




On RHEL 6.4 which is the best setting for wal_sync_method for write intensive operations. Is the default fdatasync good for all conditions, including reliability. 

Thanks 		 	   		   		 	   		  =

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Best setting for wal_sync_method
@ 2015-05-08 08:08  Albe Laurenz <laurenz.albe@wien.gv.at>
  parent: Ravi Krishna <srkrishna@outlook.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Albe Laurenz @ 2015-05-08 08:08 UTC (permalink / raw)
  To: 'Ravi Krishna *EXTERN*' <srkrishna@outlook.com>; pgsql-admin

Ravi Krishna wrote:
> On RHEL 6.4 which is the best setting for wal_sync_method for write intensive operations. Is the
> default fdatasync good for all conditions, including reliability.

Yes; you should not change that.
At least not without running performance tests.
There is the pg_test_fsync contrib that can help you test the different methods.
http://www.postgresql.org/docs/current/static/pgtestfsync.html

> Speaking to the sys admins we found that the file system where the WAL was written to did not have
> direct_io and hence all writes were getting buffered. So we enabled direct_io on that FS and now
> writes are order of magnitude slower (5x times).
> 
> It seems PG already uses O_DIRECT for WAL. So is the enabling of direct_io in the mount options of the
> FS totally redundant. It definitely has a serious performance impact.

You should not use direct I/O with PostgreSQL.

All that is required is that the file system and the underlying hardware honors
the fsync() (or fdatasync()) system calls, i.e. it is guaranteed that when these
functions return, the written data cannot get lost by a subsequent crash.
You want to make very sure that that is the case, otherwise your database
*will* be corrupted after a crash some day.

Yours,
Laurenz Albe

-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2015-05-08 08:08 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-05-07 13:36 Best setting for wal_sync_method Ravi Krishna <srkrishna@outlook.com>
2015-05-07 16:19 ` Ravi Krishna <srkrishna@outlook.com>
2015-05-08 08:08   ` Albe Laurenz <laurenz.albe@wien.gv.at>

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