pgsql: Use vectored I/O to fill new WAL segments. - Mailing list pgsql-committers

From Thomas Munro
Subject pgsql: Use vectored I/O to fill new WAL segments.
Date
Msg-id E1kymzP-0007zD-SM@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Use vectored I/O to fill new WAL segments.

Instead of making many block-sized write() calls to fill a new WAL file
with zeroes, make a smaller number of pwritev() calls (or various
emulations).  The actual number depends on the OS's IOV_MAX, which
PG_IOV_MAX currently caps at 32.  That means we'll write 256kB per call
on typical systems.  We may want to tune the number later with more
experience.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/CA%2BhUKGJA%2Bu-220VONeoREBXJ9P3S94Y7J%2BkqCnTYmahvZJwM%3Dg%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ce6a71fa5300cf00adf32c9daee302c523609709

Modified Files
--------------
src/backend/access/transam/xlog.c | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)


pgsql-committers by date:

Previous
From: Bruce Momjian
Date:
Subject: pgsql: doc: expand description of how non-SELECT queries are processed
Next
From: Tom Lane
Date:
Subject: pgsql: In libpq, always append new error messages to conn->errorMessage