Re: [HACKERS] Wal sync odirect

From: Миша Тюрин <tmihail(at)bk(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org <pgsql-hackers(at)postgresql(dot)org>
Cc: Craig Ringer <craig(at)2ndquadrant(dot)com>
Subject: Re: [HACKERS] Wal sync odirect
Date: 2013-07-22 07:30:48
Message-ID: 1374478247.526261136@f435.i.mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


i tell about wal_level is higher than MINIMAL

wal_level != minimal
http://doxygen.postgresql.org/xlogdefs_8h_source.html
"
48   * Because O_DIRECT bypasses the kernel buffers, and because we never
49   * read those buffers except during crash recovery or if wal_level != minimal "

>> hi, list. there are my proposal. i would like to tell about odirect in wal sync in wal_level is higher than minimal. i think in my case when wal traffic is up to 1gb per 2-3 minutes but discs hardware with 2gb bbu cache (or maybe ssd under wal) - there would be better if wall traffic could not harm os memory eviction. and i do not use streaming. my archive command may read wal directly without os cache. just opinion, i have not done any tests yet. but i am still under the some memory eviction anomaly.
>
>PostgreSQL already uses O_DIRECT for WAL writes if you use O_SYNC mode
>for WAL writes. See comments in src/include/access/xlogdefs.h (search
>for O_DIRECT). You should also examine
>src/backend/access/transam/xlog.c, particularly the function
>get_sync_bit(...)
>
>Try doing some tests with pg_test_fsync, see how performance looks. If
>your theory is right and WAL traffic is putting pressure on kernel write
>buffers, using fsync=open_datasync - which should be the default on
>Linux - may help.
>
>I'd recommend doing some detailed tracing and performance measurements
>before trying to proceed further.
>
>--
> Craig Ringer http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>
>
>--
>Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
>To make changes to your subscription:
>http://www.postgresql.org/mailpref/pgsql-hackers

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2013-07-22 07:39:50 Re: Re: [HACKERS] Wal sync odirect
Previous Message Kyotaro HORIGUCHI 2013-07-22 07:20:54 Re: Reduce maximum error in tuples estimation after vacuum.