mirror of
https://github.com/postgres/postgres.git
synced 2025-08-28 18:48:04 +03:00
Don't use O_DIRECT when writing WAL files if archiving or streaming is
enabled. Bypassing the kernel cache is counter-productive in that case, because the archiver/walsender process will read from the WAL file soon after it's written, and if it's not cached the read will cause a physical read, eating I/O bandwidth available on the WAL drive. Also, walreceiver process does unaligned writes, so disable O_DIRECT in walreceiver process for that reason too.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* Portions Copyright (c) 2010-2010, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/replication/walreceiver.h,v 1.6 2010/02/03 09:47:19 heikki Exp $
|
||||
* $PostgreSQL: pgsql/src/include/replication/walreceiver.h,v 1.7 2010/02/19 10:51:04 heikki Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -15,6 +15,8 @@
|
||||
#include "access/xlogdefs.h"
|
||||
#include "storage/spin.h"
|
||||
|
||||
extern bool am_walreceiver;
|
||||
|
||||
/*
|
||||
* MAXCONNINFO: maximum size of a connection string.
|
||||
*
|
||||
|
Reference in New Issue
Block a user