snapshot scalability: Move PGXACT->xmin back to PGPROC.
Andres Freund <andres@anarazel.de>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/gist/gistxlog.c | modified | +1 −1 |
| src/backend/access/nbtree/nbtpage.c | modified | +1 −1 |
| src/backend/access/transam/README | modified | +2 −2 |
| src/backend/access/transam/twophase.c | modified | +1 −1 |
| src/backend/commands/indexcmds.c | modified | +1 −1 |
| src/backend/replication/logical/snapbuild.c | modified | +3 −3 |
| src/backend/replication/walsender.c | modified | +5 −5 |
| src/backend/storage/ipc/procarray.c | modified | +16 −20 |
| src/backend/storage/ipc/sinvaladt.c | modified | +1 −1 |
| src/backend/storage/lmgr/proc.c | modified | +2 −2 |
| src/backend/utils/time/snapmgr.c | modified | +14 −14 |
| src/include/storage/proc.h | modified | +5 −5 |
Discussion
- Improving connection scalability: GetSnapshotData() 119 messages · 2020-03-01 → 2021-03-01