pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: snapshot scalability: Move PGXACT->xmin back to PGPROC.
Date: Thu, 13 Aug 2020 23:26:46 +0000
Message-ID: <E1k6McQ-00019C-CW@gemulon.postgresql.org> (raw)

snapshot scalability: Move PGXACT->xmin back to PGPROC.

Now that xmin isn't needed for GetSnapshotData() anymore, it leads to
unnecessary cacheline ping-pong to have it in PGXACT, as it is updated
considerably more frequently than the other PGXACT members.

After the changes in dc7420c2c92, this is a very straight-forward change.

For highly concurrent, snapshot acquisition heavy, workloads this change alone
can significantly increase scalability. E.g. plain pgbench on a smaller 2
socket machine gains 1.07x for read-only pgbench, 1.22x for read-only pgbench
when submitting queries in batches of 100, and 2.85x for batches of 100
'SELECT';.  The latter numbers are obviously not to be expected in the
real-world, but micro-benchmark the snapshot computation
scalability (previously spending ~80% of the time in GetSnapshotData()).

Author: Andres Freund <andres@anarazel.de>
Reviewed-By: Robert Haas <robertmhaas@gmail.com>
Reviewed-By: Thomas Munro <thomas.munro@gmail.com>
Reviewed-By: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/20200301083601.ews6hz5dduc3w2se@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1f51c17c68d05c28d5b9294d8013cb9e7e653160

Modified Files
--------------
src/backend/access/gist/gistxlog.c          |  2 +-
src/backend/access/nbtree/nbtpage.c         |  2 +-
src/backend/access/transam/README           |  4 ++--
src/backend/access/transam/twophase.c       |  2 +-
src/backend/commands/indexcmds.c            |  2 +-
src/backend/replication/logical/snapbuild.c |  6 ++---
src/backend/replication/walsender.c         | 10 ++++----
src/backend/storage/ipc/procarray.c         | 36 +++++++++++++----------------
src/backend/storage/ipc/sinvaladt.c         |  2 +-
src/backend/storage/lmgr/proc.c             |  4 ++--
src/backend/utils/time/snapmgr.c            | 28 +++++++++++-----------
src/include/storage/proc.h                  | 10 ++++----
12 files changed, 52 insertions(+), 56 deletions(-)



Message-ID: <E1k6McQ-00019C-CW@gemulon.postgresql.org>
Permalink:  ../E1k6McQ-00019C-CW@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1k6McQ-00019C-CW@gemulon.postgresql.org

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: snapshot scalability: Move PGXACT->xmin back to PGPROC.
  In-Reply-To: <E1k6McQ-00019C-CW@gemulon.postgresql.org>
  References: <E1k6McQ-00019C-CW@gemulon.postgresql.org>

* 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