pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Should we cacheline align PGXACT?
84+ messages / 15 participants
[nested] [flat]

* Should we cacheline align PGXACT?
@ 2016-08-19 06:12 Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-19 12:19 ` Re: Should we cacheline align PGXACT? Amit Kapila <amit.kapila16@gmail.com>
  2016-08-19 13:46 ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  0 siblings, 3 replies; 84+ messages in thread

From: Alexander Korotkov @ 2016-08-19 06:12 UTC (permalink / raw)
  To: pgsql-hackers

Hackers,

originally this idea was proposed by Andres Freund while experimenting with
lockfree Pin/UnpinBuffer [1].
The patch is attached as well as results of pgbench -S on 72-cores
machine.  As before it shows huge benefit in this case.
For sure, we should validate that it doesn't cause performance regression
in other cases.  At least we should test read-write and smaller machines.
Any other ideas?

1.
https://www.postgresql.org/message-id/20160411214029.ce3fw6zxim5k6a2r@alap3.anarazel.de

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

pgxact-align-1.patch (application/octet-stream, 24.2K) download diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c new file mode 100644 index 9f55adc..c4d5efa *** a/src/backend/access/transam/twophase.c --- b/src/backend/access/transam/twophase.c *************** MarkAsPreparing(TransactionId xid, const *** 403,409 **** TwoPhaseState->freeGXacts = gxact->next; proc = &ProcGlobal->allProcs[gxact->pgprocno]; ! pgxact = &ProcGlobal->allPgXact[gxact->pgprocno]; /* Initialize the PGPROC entry */ MemSet(proc, 0, sizeof(PGPROC)); --- 403,409 ---- TwoPhaseState->freeGXacts = gxact->next; proc = &ProcGlobal->allProcs[gxact->pgprocno]; ! pgxact = &ProcGlobal->allPgXact[gxact->pgprocno].xact; /* Initialize the PGPROC entry */ MemSet(proc, 0, sizeof(PGPROC)); *************** GXactLoadSubxactData(GlobalTransaction g *** 467,473 **** TransactionId *children) { PGPROC *proc = &ProcGlobal->allProcs[gxact->pgprocno]; ! PGXACT *pgxact = &ProcGlobal->allPgXact[gxact->pgprocno]; /* We need no extra lock since the GXACT isn't valid yet */ if (nsubxacts > PGPROC_MAX_CACHED_SUBXIDS) --- 467,473 ---- TransactionId *children) { PGPROC *proc = &ProcGlobal->allProcs[gxact->pgprocno]; ! PGXACT *pgxact = &ProcGlobal->allPgXact[gxact->pgprocno].xact; /* We need no extra lock since the GXACT isn't valid yet */ if (nsubxacts > PGPROC_MAX_CACHED_SUBXIDS) *************** pg_prepared_xact(PG_FUNCTION_ARGS) *** 725,731 **** { GlobalTransaction gxact = &status->array[status->currIdx++]; PGPROC *proc = &ProcGlobal->allProcs[gxact->pgprocno]; ! PGXACT *pgxact = &ProcGlobal->allPgXact[gxact->pgprocno]; Datum values[5]; bool nulls[5]; HeapTuple tuple; --- 725,731 ---- { GlobalTransaction gxact = &status->array[status->currIdx++]; PGPROC *proc = &ProcGlobal->allProcs[gxact->pgprocno]; ! PGXACT *pgxact = &ProcGlobal->allPgXact[gxact->pgprocno].xact; Datum values[5]; bool nulls[5]; HeapTuple tuple; *************** TwoPhaseGetGXact(TransactionId xid) *** 780,786 **** for (i = 0; i < TwoPhaseState->numPrepXacts; i++) { GlobalTransaction gxact = TwoPhaseState->prepXacts[i]; ! PGXACT *pgxact = &ProcGlobal->allPgXact[gxact->pgprocno]; if (pgxact->xid == xid) { --- 780,786 ---- for (i = 0; i < TwoPhaseState->numPrepXacts; i++) { GlobalTransaction gxact = TwoPhaseState->prepXacts[i]; ! PGXACT *pgxact = &ProcGlobal->allPgXact[gxact->pgprocno].xact; if (pgxact->xid == xid) { *************** void *** 947,953 **** StartPrepare(GlobalTransaction gxact) { PGPROC *proc = &ProcGlobal->allProcs[gxact->pgprocno]; ! PGXACT *pgxact = &ProcGlobal->allPgXact[gxact->pgprocno]; TransactionId xid = pgxact->xid; TwoPhaseFileHeader hdr; TransactionId *children; --- 947,953 ---- StartPrepare(GlobalTransaction gxact) { PGPROC *proc = &ProcGlobal->allProcs[gxact->pgprocno]; ! PGXACT *pgxact = &ProcGlobal->allPgXact[gxact->pgprocno].xact; TransactionId xid = pgxact->xid; TwoPhaseFileHeader hdr; TransactionId *children; *************** FinishPreparedTransaction(const char *gi *** 1343,1349 **** */ gxact = LockGXact(gid, GetUserId()); proc = &ProcGlobal->allProcs[gxact->pgprocno]; ! pgxact = &ProcGlobal->allPgXact[gxact->pgprocno]; xid = pgxact->xid; /* --- 1343,1349 ---- */ gxact = LockGXact(gid, GetUserId()); proc = &ProcGlobal->allProcs[gxact->pgprocno]; ! pgxact = &ProcGlobal->allPgXact[gxact->pgprocno].xact; xid = pgxact->xid; /* *************** CheckPointTwoPhase(XLogRecPtr redo_horiz *** 1623,1629 **** for (i = 0; i < TwoPhaseState->numPrepXacts; i++) { GlobalTransaction gxact = TwoPhaseState->prepXacts[i]; ! PGXACT *pgxact = &ProcGlobal->allPgXact[gxact->pgprocno]; if (gxact->valid && !gxact->ondisk && --- 1623,1629 ---- for (i = 0; i < TwoPhaseState->numPrepXacts; i++) { GlobalTransaction gxact = TwoPhaseState->prepXacts[i]; ! PGXACT *pgxact = &ProcGlobal->allPgXact[gxact->pgprocno].xact; if (gxact->valid && !gxact->ondisk && diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c new file mode 100644 index e5d487d..4af233e *** a/src/backend/storage/ipc/procarray.c --- b/src/backend/storage/ipc/procarray.c *************** typedef struct ProcArrayStruct *** 97,103 **** static ProcArrayStruct *procArray; static PGPROC *allProcs; ! static PGXACT *allPgXact; /* * Bookkeeping for tracking emulated transactions in recovery --- 97,103 ---- static ProcArrayStruct *procArray; static PGPROC *allProcs; ! static PGXACTPadded *allPgXact; /* * Bookkeeping for tracking emulated transactions in recovery *************** ProcArrayRemove(PGPROC *proc, Transactio *** 350,356 **** if (TransactionIdIsValid(latestXid)) { ! Assert(TransactionIdIsValid(allPgXact[proc->pgprocno].xid)); /* Advance global latestCompletedXid while holding the lock */ if (TransactionIdPrecedes(ShmemVariableCache->latestCompletedXid, --- 350,356 ---- if (TransactionIdIsValid(latestXid)) { ! Assert(TransactionIdIsValid(allPgXact[proc->pgprocno].xact.xid)); /* Advance global latestCompletedXid while holding the lock */ if (TransactionIdPrecedes(ShmemVariableCache->latestCompletedXid, *************** ProcArrayRemove(PGPROC *proc, Transactio *** 360,366 **** else { /* Shouldn't be trying to remove a live transaction here */ ! Assert(!TransactionIdIsValid(allPgXact[proc->pgprocno].xid)); } for (index = 0; index < arrayP->numProcs; index++) --- 360,366 ---- else { /* Shouldn't be trying to remove a live transaction here */ ! Assert(!TransactionIdIsValid(allPgXact[proc->pgprocno].xact.xid)); } for (index = 0; index < arrayP->numProcs; index++) *************** ProcArrayRemove(PGPROC *proc, Transactio *** 400,406 **** void ProcArrayEndTransaction(PGPROC *proc, TransactionId latestXid) { ! PGXACT *pgxact = &allPgXact[proc->pgprocno]; if (TransactionIdIsValid(latestXid)) { --- 400,406 ---- void ProcArrayEndTransaction(PGPROC *proc, TransactionId latestXid) { ! PGXACT *pgxact = &allPgXact[proc->pgprocno].xact; if (TransactionIdIsValid(latestXid)) { *************** ProcArrayEndTransaction(PGPROC *proc, Tr *** 410,416 **** * else is taking a snapshot. See discussion in * src/backend/access/transam/README. */ ! Assert(TransactionIdIsValid(allPgXact[proc->pgprocno].xid)); /* * If we can immediately acquire ProcArrayLock, we clear our own XID --- 410,416 ---- * else is taking a snapshot. See discussion in * src/backend/access/transam/README. */ ! Assert(TransactionIdIsValid(allPgXact[proc->pgprocno].xact.xid)); /* * If we can immediately acquire ProcArrayLock, we clear our own XID *************** ProcArrayEndTransaction(PGPROC *proc, Tr *** 432,438 **** * anyone else's calculation of a snapshot. We might change their * estimate of global xmin, but that's OK. */ ! Assert(!TransactionIdIsValid(allPgXact[proc->pgprocno].xid)); proc->lxid = InvalidLocalTransactionId; pgxact->xmin = InvalidTransactionId; --- 432,438 ---- * anyone else's calculation of a snapshot. We might change their * estimate of global xmin, but that's OK. */ ! Assert(!TransactionIdIsValid(allPgXact[proc->pgprocno].xact.xid)); proc->lxid = InvalidLocalTransactionId; pgxact->xmin = InvalidTransactionId; *************** ProcArrayGroupClearXid(PGPROC *proc, Tra *** 494,500 **** int extraWaits = -1; /* We should definitely have an XID to clear. */ ! Assert(TransactionIdIsValid(allPgXact[proc->pgprocno].xid)); /* Add ourselves to the list of processes needing a group XID clear. */ proc->procArrayGroupMember = true; --- 494,500 ---- int extraWaits = -1; /* We should definitely have an XID to clear. */ ! Assert(TransactionIdIsValid(allPgXact[proc->pgprocno].xact.xid)); /* Add ourselves to the list of processes needing a group XID clear. */ proc->procArrayGroupMember = true; *************** ProcArrayGroupClearXid(PGPROC *proc, Tra *** 560,566 **** while (nextidx != INVALID_PGPROCNO) { PGPROC *proc = &allProcs[nextidx]; ! PGXACT *pgxact = &allPgXact[nextidx]; ProcArrayEndTransactionInternal(proc, pgxact, proc->procArrayGroupMemberXid); --- 560,566 ---- while (nextidx != INVALID_PGPROCNO) { PGPROC *proc = &allProcs[nextidx]; ! PGXACT *pgxact = &allPgXact[nextidx].xact; ProcArrayEndTransactionInternal(proc, pgxact, proc->procArrayGroupMemberXid); *************** ProcArrayGroupClearXid(PGPROC *proc, Tra *** 606,612 **** void ProcArrayClearTransaction(PGPROC *proc) { ! PGXACT *pgxact = &allPgXact[proc->pgprocno]; /* * We can skip locking ProcArrayLock here, because this action does not --- 606,612 ---- void ProcArrayClearTransaction(PGPROC *proc) { ! PGXACT *pgxact = &allPgXact[proc->pgprocno].xact; /* * We can skip locking ProcArrayLock here, because this action does not *************** TransactionIdIsInProgress(TransactionId *** 1078,1084 **** { int pgprocno = arrayP->pgprocnos[i]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; TransactionId pxid; /* Ignore my own proc --- dealt with it above */ --- 1078,1084 ---- { int pgprocno = arrayP->pgprocnos[i]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; TransactionId pxid; /* Ignore my own proc --- dealt with it above */ *************** TransactionIdIsActive(TransactionId xid) *** 1234,1240 **** { int pgprocno = arrayP->pgprocnos[i]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; TransactionId pxid; /* Fetch xid just once - see GetNewTransactionId */ --- 1234,1240 ---- { int pgprocno = arrayP->pgprocnos[i]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; TransactionId pxid; /* Fetch xid just once - see GetNewTransactionId */ *************** GetOldestXmin(Relation rel, bool ignoreV *** 1344,1350 **** { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; /* * Backend is doing logical decoding which manages xmin separately, --- 1344,1350 ---- { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; /* * Backend is doing logical decoding which manages xmin separately, *************** GetSnapshotData(Snapshot snapshot) *** 1583,1589 **** for (index = 0; index < numProcs; index++) { int pgprocno = pgprocnos[index]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; TransactionId xid; /* --- 1583,1589 ---- for (index = 0; index < numProcs; index++) { int pgprocno = pgprocnos[index]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; TransactionId xid; /* *************** ProcArrayInstallImportedXmin(Transaction *** 1811,1817 **** { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; TransactionId xid; /* Ignore procs running LAZY VACUUM */ --- 1811,1817 ---- { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; TransactionId xid; /* Ignore procs running LAZY VACUUM */ *************** ProcArrayInstallRestoredXmin(Transaction *** 1878,1884 **** /* Get lock so source xact can't end while we're doing this */ LWLockAcquire(ProcArrayLock, LW_SHARED); ! pgxact = &allPgXact[proc->pgprocno]; /* * Be certain that the referenced PGPROC has an advertised xmin which is --- 1878,1884 ---- /* Get lock so source xact can't end while we're doing this */ LWLockAcquire(ProcArrayLock, LW_SHARED); ! pgxact = &allPgXact[proc->pgprocno].xact; /* * Be certain that the referenced PGPROC has an advertised xmin which is *************** GetRunningTransactionData(void) *** 1989,1995 **** for (index = 0; index < arrayP->numProcs; index++) { int pgprocno = arrayP->pgprocnos[index]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; TransactionId xid; /* Fetch xid just once - see GetNewTransactionId */ --- 1989,1995 ---- for (index = 0; index < arrayP->numProcs; index++) { int pgprocno = arrayP->pgprocnos[index]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; TransactionId xid; /* Fetch xid just once - see GetNewTransactionId */ *************** GetRunningTransactionData(void) *** 2021,2027 **** { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; int nxids; /* --- 2021,2027 ---- { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; int nxids; /* *************** GetOldestActiveTransactionId(void) *** 2111,2117 **** for (index = 0; index < arrayP->numProcs; index++) { int pgprocno = arrayP->pgprocnos[index]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; TransactionId xid; /* Fetch xid just once - see GetNewTransactionId */ --- 2111,2117 ---- for (index = 0; index < arrayP->numProcs; index++) { int pgprocno = arrayP->pgprocnos[index]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; TransactionId xid; /* Fetch xid just once - see GetNewTransactionId */ *************** GetOldestSafeDecodingTransactionId(void) *** 2202,2208 **** for (index = 0; index < arrayP->numProcs; index++) { int pgprocno = arrayP->pgprocnos[index]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; TransactionId xid; /* Fetch xid just once - see GetNewTransactionId */ --- 2202,2208 ---- for (index = 0; index < arrayP->numProcs; index++) { int pgprocno = arrayP->pgprocnos[index]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; TransactionId xid; /* Fetch xid just once - see GetNewTransactionId */ *************** GetVirtualXIDsDelayingChkpt(int *nvxids) *** 2257,2263 **** { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; if (pgxact->delayChkpt) { --- 2257,2263 ---- { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; if (pgxact->delayChkpt) { *************** HaveVirtualXIDsDelayingChkpt(VirtualTran *** 2297,2303 **** { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; VirtualTransactionId vxid; GET_VXID_FROM_PGPROC(vxid, *proc); --- 2297,2303 ---- { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; VirtualTransactionId vxid; GET_VXID_FROM_PGPROC(vxid, *proc); *************** BackendXidGetPid(TransactionId xid) *** 2407,2413 **** { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; if (pgxact->xid == xid) { --- 2407,2413 ---- { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; if (pgxact->xid == xid) { *************** GetCurrentVirtualXIDs(TransactionId limi *** 2479,2485 **** { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; if (proc == MyProc) continue; --- 2479,2485 ---- { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; if (proc == MyProc) continue; *************** GetConflictingVirtualXIDs(TransactionId *** 2576,2582 **** { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; /* Exclude prepared transactions */ if (proc->pid == 0) --- 2576,2582 ---- { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; /* Exclude prepared transactions */ if (proc->pid == 0) *************** MinimumActiveBackends(int min) *** 2690,2696 **** { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; /* * Since we're not holding a lock, need to be prepared to deal with --- 2690,2696 ---- { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; /* * Since we're not holding a lock, need to be prepared to deal with *************** CountOtherDBBackends(Oid databaseId, int *** 2867,2873 **** { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno]; if (proc->databaseId != databaseId) continue; --- 2867,2873 ---- { int pgprocno = arrayP->pgprocnos[index]; volatile PGPROC *proc = &allProcs[pgprocno]; ! volatile PGXACT *pgxact = &allPgXact[pgprocno].xact; if (proc->databaseId != databaseId) continue; diff --git a/src/backend/storage/ipc/sinvaladt.c b/src/backend/storage/ipc/sinvaladt.c new file mode 100644 index 44a9f2c..9a1d106 *** a/src/backend/storage/ipc/sinvaladt.c --- b/src/backend/storage/ipc/sinvaladt.c *************** BackendIdGetTransactionIds(int backendID *** 418,424 **** if (proc != NULL) { ! PGXACT *xact = &ProcGlobal->allPgXact[proc->pgprocno]; *xid = xact->xid; *xmin = xact->xmin; --- 418,424 ---- if (proc != NULL) { ! PGXACT *xact = &ProcGlobal->allPgXact[proc->pgprocno].xact; *xid = xact->xid; *xmin = xact->xmin; diff --git a/src/backend/storage/lmgr/deadlock.c b/src/backend/storage/lmgr/deadlock.c new file mode 100644 index 3f3e24f..1f5528e *** a/src/backend/storage/lmgr/deadlock.c --- b/src/backend/storage/lmgr/deadlock.c *************** FindLockCycleRecurseMember(PGPROC *check *** 573,579 **** PGPROC *leader; proc = proclock->tag.myProc; ! pgxact = &ProcGlobal->allPgXact[proc->pgprocno]; leader = proc->lockGroupLeader == NULL ? proc : proc->lockGroupLeader; /* A proc never blocks itself or any other lock group member */ --- 573,579 ---- PGPROC *leader; proc = proclock->tag.myProc; ! pgxact = &ProcGlobal->allPgXact[proc->pgprocno].xact; leader = proc->lockGroupLeader == NULL ? proc : proc->lockGroupLeader; /* A proc never blocks itself or any other lock group member */ diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c new file mode 100644 index dba3809..714b6bf *** a/src/backend/storage/lmgr/lock.c --- b/src/backend/storage/lmgr/lock.c *************** GetRunningTransactionLocks(int *nlocks) *** 3806,3812 **** proclock->tag.myLock->tag.locktag_type == LOCKTAG_RELATION) { PGPROC *proc = proclock->tag.myProc; ! PGXACT *pgxact = &ProcGlobal->allPgXact[proc->pgprocno]; LOCK *lock = proclock->tag.myLock; TransactionId xid = pgxact->xid; --- 3806,3812 ---- proclock->tag.myLock->tag.locktag_type == LOCKTAG_RELATION) { PGPROC *proc = proclock->tag.myProc; ! PGXACT *pgxact = &ProcGlobal->allPgXact[proc->pgprocno].xact; LOCK *lock = proclock->tag.myLock; TransactionId xid = pgxact->xid; diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c new file mode 100644 index 9a758bd..a555b2a *** a/src/backend/storage/lmgr/proc.c --- b/src/backend/storage/lmgr/proc.c *************** void *** 160,166 **** InitProcGlobal(void) { PGPROC *procs; ! PGXACT *pgxacts; int i, j; bool found; --- 160,166 ---- InitProcGlobal(void) { PGPROC *procs; ! PGXACTPadded *pgxacts; int i, j; bool found; *************** InitProcGlobal(void) *** 211,218 **** * multiprocessor system. There is one PGXACT structure for every PGPROC * structure. */ ! pgxacts = (PGXACT *) ShmemAlloc(TotalProcs * sizeof(PGXACT)); ! MemSet(pgxacts, 0, TotalProcs * sizeof(PGXACT)); ProcGlobal->allPgXact = pgxacts; for (i = 0; i < TotalProcs; i++) --- 211,218 ---- * multiprocessor system. There is one PGXACT structure for every PGPROC * structure. */ ! pgxacts = (PGXACTPadded *) ShmemAlloc(TotalProcs * sizeof(PGXACTPadded)); ! MemSet(pgxacts, 0, TotalProcs * sizeof(PGXACTPadded)); ProcGlobal->allPgXact = pgxacts; for (i = 0; i < TotalProcs; i++) *************** InitProcess(void) *** 339,345 **** (errcode(ERRCODE_TOO_MANY_CONNECTIONS), errmsg("sorry, too many clients already"))); } ! MyPgXact = &ProcGlobal->allPgXact[MyProc->pgprocno]; /* * Cross-check that the PGPROC is of the type we expect; if this were not --- 339,345 ---- (errcode(ERRCODE_TOO_MANY_CONNECTIONS), errmsg("sorry, too many clients already"))); } ! MyPgXact = &ProcGlobal->allPgXact[MyProc->pgprocno].xact; /* * Cross-check that the PGPROC is of the type we expect; if this were not *************** InitAuxiliaryProcess(void) *** 526,532 **** ((volatile PGPROC *) auxproc)->pid = MyProcPid; MyProc = auxproc; ! MyPgXact = &ProcGlobal->allPgXact[auxproc->pgprocno]; SpinLockRelease(ProcStructLock); --- 526,532 ---- ((volatile PGPROC *) auxproc)->pid = MyProcPid; MyProc = auxproc; ! MyPgXact = &ProcGlobal->allPgXact[auxproc->pgprocno].xact; SpinLockRelease(ProcStructLock); *************** ProcSleep(LOCALLOCK *locallock, LockMeth *** 1241,1247 **** if (deadlock_state == DS_BLOCKED_BY_AUTOVACUUM && allow_autovacuum_cancel) { PGPROC *autovac = GetBlockingAutoVacuumPgproc(); ! PGXACT *autovac_pgxact = &ProcGlobal->allPgXact[autovac->pgprocno]; LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE); --- 1241,1247 ---- if (deadlock_state == DS_BLOCKED_BY_AUTOVACUUM && allow_autovacuum_cancel) { PGPROC *autovac = GetBlockingAutoVacuumPgproc(); ! PGXACT *autovac_pgxact = &ProcGlobal->allPgXact[autovac->pgprocno].xact; LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE); diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h new file mode 100644 index f576f05..0686426 *** a/src/include/storage/proc.h --- b/src/include/storage/proc.h *************** typedef struct PGXACT *** 209,214 **** --- 209,225 ---- } PGXACT; /* + * Cacheline aligned PGXACT which allows us to put each PGXACT to individual + * cacheline. Assuming PGXACTs are under intensive write, cacheline alignment + * reduce cache misses during GetSnapshotData(). + */ + typedef union PGXACTPadded + { + PGXACT xact; + char pad[PG_CACHE_LINE_SIZE]; + } PGXACTPadded; + + /* * There is one ProcGlobal struct for the whole database cluster. */ typedef struct PROC_HDR *************** typedef struct PROC_HDR *** 216,222 **** /* Array of PGPROC structures (not including dummies for prepared txns) */ PGPROC *allProcs; /* Array of PGXACT structures (not including dummies for prepared txns) */ ! PGXACT *allPgXact; /* Length of allProcs array */ uint32 allProcCount; /* Head of list of free PGPROC structures */ --- 227,233 ---- /* Array of PGPROC structures (not including dummies for prepared txns) */ PGPROC *allProcs; /* Array of PGXACT structures (not including dummies for prepared txns) */ ! PGXACTPadded *allPgXact; /* Length of allProcs array */ uint32 allProcCount; /* Head of list of free PGPROC structures */
scalability_pgxact_align.png (image/png, 47.4K) download view image
^ permalink raw reply [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2016-08-19 12:19 ` Amit Kapila <amit.kapila16@gmail.com>
  2016-08-19 14:54   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2 siblings, 1 reply; 84+ messages in thread

From: Amit Kapila @ 2016-08-19 12:19 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: pgsql-hackers

On Fri, Aug 19, 2016 at 11:42 AM, Alexander Korotkov
<a.korotkov@postgrespro.ru> wrote:
> Hackers,
>
> originally this idea was proposed by Andres Freund while experimenting with
> lockfree Pin/UnpinBuffer [1].
> The patch is attached as well as results of pgbench -S on 72-cores machine.
> As before it shows huge benefit in this case.
> For sure, we should validate that it doesn't cause performance regression in
> other cases.  At least we should test read-write and smaller machines.
> Any other ideas?
>

may be test on Power m/c as well.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-19 12:19 ` Re: Should we cacheline align PGXACT? Amit Kapila <amit.kapila16@gmail.com>
@ 2016-08-19 14:54   ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 02:50     ` Re: Should we cacheline align PGXACT? Amit Kapila <amit.kapila16@gmail.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2016-08-19 14:54 UTC (permalink / raw)
  To: Amit Kapila <amit.kapila16@gmail.com>; +Cc: pgsql-hackers

On Fri, Aug 19, 2016 at 3:19 PM, Amit Kapila <amit.kapila16@gmail.com>
wrote:

> On Fri, Aug 19, 2016 at 11:42 AM, Alexander Korotkov
> <a.korotkov@postgrespro.ru> wrote:
> > Hackers,
> >
> > originally this idea was proposed by Andres Freund while experimenting
> with
> > lockfree Pin/UnpinBuffer [1].
> > The patch is attached as well as results of pgbench -S on 72-cores
> machine.
> > As before it shows huge benefit in this case.
> > For sure, we should validate that it doesn't cause performance
> regression in
> > other cases.  At least we should test read-write and smaller machines.
> > Any other ideas?
> >
>
> may be test on Power m/c as well.
>

Good idea.  I don't have any such machine at hand now.  Do you have one?

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-19 12:19 ` Re: Should we cacheline align PGXACT? Amit Kapila <amit.kapila16@gmail.com>
  2016-08-19 14:54   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2016-08-20 02:50     ` Amit Kapila <amit.kapila16@gmail.com>
  0 siblings, 0 replies; 84+ messages in thread

From: Amit Kapila @ 2016-08-20 02:50 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: pgsql-hackers

On Fri, Aug 19, 2016 at 8:24 PM, Alexander Korotkov
<a.korotkov@postgrespro.ru> wrote:
> On Fri, Aug 19, 2016 at 3:19 PM, Amit Kapila <amit.kapila16@gmail.com>
> wrote:
>>
>> On Fri, Aug 19, 2016 at 11:42 AM, Alexander Korotkov
>> <a.korotkov@postgrespro.ru> wrote:
>> > Hackers,
>> >
>> > originally this idea was proposed by Andres Freund while experimenting
>> > with
>> > lockfree Pin/UnpinBuffer [1].
>> > The patch is attached as well as results of pgbench -S on 72-cores
>> > machine.
>> > As before it shows huge benefit in this case.
>> > For sure, we should validate that it doesn't cause performance
>> > regression in
>> > other cases.  At least we should test read-write and smaller machines.
>> > Any other ideas?
>> >
>>
>> may be test on Power m/c as well.
>
>
> Good idea.  I don't have any such machine at hand now.  Do you have one?
>

Yes, I can help in testing this patch during CF.  Feel free to ping,
if I missed or forgot to do same.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2016-08-19 13:46 ` Tom Lane <tgl@sss.pgh.pa.us>
  2016-08-19 14:50   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-22 02:40   ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2 siblings, 2 replies; 84+ messages in thread

From: Tom Lane @ 2016-08-19 13:46 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: pgsql-hackers

Alexander Korotkov <a.korotkov@postgrespro.ru> writes:
> originally this idea was proposed by Andres Freund while experimenting with
> lockfree Pin/UnpinBuffer [1].
> The patch is attached as well as results of pgbench -S on 72-cores
> machine.  As before it shows huge benefit in this case.

That's one mighty ugly patch.  Can't you do it without needing to
introduce the additional layer of struct nesting?

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-19 13:46 ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-08-19 14:50   ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-19 15:46     ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2016-08-19 14:50 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers

On Fri, Aug 19, 2016 at 4:46 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Alexander Korotkov <a.korotkov@postgrespro.ru> writes:
> > originally this idea was proposed by Andres Freund while experimenting
> with
> > lockfree Pin/UnpinBuffer [1].
> > The patch is attached as well as results of pgbench -S on 72-cores
> > machine.  As before it shows huge benefit in this case.
>
> That's one mighty ugly patch.  Can't you do it without needing to
> introduce the additional layer of struct nesting?
>

That's worrying me too.
We could use anonymous struct, but it seems to be prohibited in C89 which
we stick to.
Another idea, which comes to my mind, is to manually calculate size of
padding and insert it directly to PGXACT struct.  But that seems rather
ugly too.  However, it would be ugly definition not ugly usage...
Do you have better ideas?

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-19 13:46 ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2016-08-19 14:50   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2016-08-19 15:46     ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 84+ messages in thread

From: Tom Lane @ 2016-08-19 15:46 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: pgsql-hackers

Alexander Korotkov <a.korotkov@postgrespro.ru> writes:
> On Fri, Aug 19, 2016 at 4:46 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> That's one mighty ugly patch.  Can't you do it without needing to
>> introduce the additional layer of struct nesting?

> That's worrying me too.
> We could use anonymous struct, but it seems to be prohibited in C89 which
> we stick to.
> Another idea, which comes to my mind, is to manually calculate size of
> padding and insert it directly to PGXACT struct.  But that seems rather
> ugly too.  However, it would be ugly definition not ugly usage...
> Do you have better ideas?

No, that was the best one that had occurred to me, too.  You could
probably introduce a StaticAssert that sizeof(PGXACT) is a power of 2
as a means of checking that the manual padding calculation hadn't
gotten broken.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-19 13:46 ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-08-22 02:40   ` Andres Freund <andres@anarazel.de>
  2016-08-22 03:25     ` Re: Should we cacheline align PGXACT? Craig Ringer <craig@2ndquadrant.com>
  1 sibling, 1 reply; 84+ messages in thread

From: Andres Freund @ 2016-08-22 02:40 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>; pgsql-hackers

On 2016-08-19 09:46:12 -0400, Tom Lane wrote:
> Alexander Korotkov <a.korotkov@postgrespro.ru> writes:
> > originally this idea was proposed by Andres Freund while experimenting with
> > lockfree Pin/UnpinBuffer [1].
> > The patch is attached as well as results of pgbench -S on 72-cores
> > machine.  As before it shows huge benefit in this case.
> 
> That's one mighty ugly patch.

My version of it was only intended to nail down some variability on the
pgpro machine, it wasn't intended for submission.


> Can't you do it without needing to introduce the additional layer of
> struct nesting?

If we required support for anonymous unions, such things would be a lot
easier to do.  That aside, the only alternative seems tob e hard-coding
padding space - which probably isn't all that un-fragile either.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-19 13:46 ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2016-08-22 02:40   ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
@ 2016-08-22 03:25     ` Craig Ringer <craig@2ndquadrant.com>
  2016-08-22 05:24       ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  0 siblings, 1 reply; 84+ messages in thread

From: Craig Ringer @ 2016-08-22 03:25 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Alexander Korotkov <a.korotkov@postgrespro.ru>; pgsql-hackers

On 22 August 2016 at 10:40, Andres Freund <andres@anarazel.de> wrote:

> On 2016-08-19 09:46:12 -0400, Tom Lane wrote:
> > Alexander Korotkov <a.korotkov@postgrespro.ru> writes:
> > > originally this idea was proposed by Andres Freund while experimenting
> with
> > > lockfree Pin/UnpinBuffer [1].
> > > The patch is attached as well as results of pgbench -S on 72-cores
> > > machine.  As before it shows huge benefit in this case.
> >
> > That's one mighty ugly patch.
>
> My version of it was only intended to nail down some variability on the
> pgpro machine, it wasn't intended for submission.
>
>
> > Can't you do it without needing to introduce the additional layer of
> > struct nesting?
>
> If we required support for anonymous unions, such things would be a lot
> easier to do.  That aside, the only alternative seems tob e hard-coding
> padding space - which probably isn't all that un-fragile either.
> <http://www.postgresql.org/mailpref/pgsql-hackers;
>

Somewhat naïve question from someone with much less clue about low level
cache behaviour trying to follow along: given that we determine such
padding at compile time, how do we ensure that the cacheline size we're
targeting is right at runtime? Or is it safe to assume that using 16 bytes
so we don't cross cache line boundaries is always helpful, whether we have
4 PGXACT entries (64 byte line) or some other number per cacheline?

Also, for anyone else following this discussion who wants to understand it
better, take a look at
http://igoro.com/archive/gallery-of-processor-cache-effects/ .

-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-19 13:46 ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2016-08-22 02:40   ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2016-08-22 03:25     ` Re: Should we cacheline align PGXACT? Craig Ringer <craig@2ndquadrant.com>
@ 2016-08-22 05:24       ` Andres Freund <andres@anarazel.de>
  2017-02-13 01:57         ` Re: Should we cacheline align PGXACT? Jim Nasby <Jim.Nasby@BlueTreble.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Andres Freund @ 2016-08-22 05:24 UTC (permalink / raw)
  To: Craig Ringer <craig@2ndquadrant.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Alexander Korotkov <a.korotkov@postgrespro.ru>; pgsql-hackers

On 2016-08-22 11:25:55 +0800, Craig Ringer wrote:
> On 22 August 2016 at 10:40, Andres Freund <andres@anarazel.de> wrote:
> 
> > On 2016-08-19 09:46:12 -0400, Tom Lane wrote:
> > > Alexander Korotkov <a.korotkov@postgrespro.ru> writes:
> > > > originally this idea was proposed by Andres Freund while experimenting
> > with
> > > > lockfree Pin/UnpinBuffer [1].
> > > > The patch is attached as well as results of pgbench -S on 72-cores
> > > > machine.  As before it shows huge benefit in this case.
> > >
> > > That's one mighty ugly patch.
> >
> > My version of it was only intended to nail down some variability on the
> > pgpro machine, it wasn't intended for submission.
> >
> >
> > > Can't you do it without needing to introduce the additional layer of
> > > struct nesting?
> >
> > If we required support for anonymous unions, such things would be a lot
> > easier to do.  That aside, the only alternative seems tob e hard-coding
> > padding space - which probably isn't all that un-fragile either.
> > <http://www.postgresql.org/mailpref/pgsql-hackers;
> >
> 
> Somewhat naïve question from someone with much less clue about low level
> cache behaviour trying to follow along: given that we determine such
> padding at compile time, how do we ensure that the cacheline size we're
> targeting is right at runtime?

There's basically only very few common cacheline sizes. Pretty much only
64 byte and 128 bytes are common these days. By usually padding to the
larger of those two, we waste a bit of memory, but not actually cache
space on platforms with smaller lines, because the padding is never
accessed.

> Or is it safe to assume that using 16 bytes so we don't cross cache
> line boundaries is always helpful, whether we have 4 PGXACT entries
> (64 byte line) or some other number per cacheline?

That's generally a good thing to do, yes.  It's probably not going to
give the full benefits here though.

Regards

Andres


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-19 13:46 ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2016-08-22 02:40   ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2016-08-22 03:25     ` Re: Should we cacheline align PGXACT? Craig Ringer <craig@2ndquadrant.com>
  2016-08-22 05:24       ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
@ 2017-02-13 01:57         ` Jim Nasby <Jim.Nasby@BlueTreble.com>
  0 siblings, 0 replies; 84+ messages in thread

From: Jim Nasby @ 2017-02-13 01:57 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; Craig Ringer <craig@2ndquadrant.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Alexander Korotkov <a.korotkov@postgrespro.ru>; pgsql-hackers

On 8/22/16 12:24 AM, Andres Freund wrote:
>> Somewhat naïve question from someone with much less clue about low level
>> cache behaviour trying to follow along: given that we determine such
>> padding at compile time, how do we ensure that the cacheline size we're
>> targeting is right at runtime?
> There's basically only very few common cacheline sizes. Pretty much only
> 64 byte and 128 bytes are common these days. By usually padding to the
> larger of those two, we waste a bit of memory, but not actually cache
> space on platforms with smaller lines, because the padding is never
> accessed.

Though, with an N-way associative cache 2x more padding than necessary 
cuts the amount you can fit into the cache by half. That could be 
meaningful in some cases.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2016-08-20 18:33 ` Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2016-08-22 02:17   ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2 siblings, 2 replies; 84+ messages in thread

From: Robert Haas @ 2016-08-20 18:33 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: pgsql-hackers

On Aug 19, 2016, at 2:12 AM, Alexander Korotkov <a.korotkov@postgrespro.ru> wrote:
> Hackers,
> 
> originally this idea was proposed by Andres Freund while experimenting with lockfree Pin/UnpinBuffer [1].
> The patch is attached as well as results of pgbench -S on 72-cores machine.  As before it shows huge benefit in this case.
> For sure, we should validate that it doesn't cause performance regression in other cases.  At least we should test read-write and smaller machines.
> Any other ideas?

Wow, nice results.  My intuition on why PGXACT helped in the first place was that it minimized the number of cache lines that had to be touched to take a snapshot. Padding obviously would somewhat increase that again, so I can't quite understand why it seems to be helping... any idea?

...Robert

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
@ 2016-08-20 18:38   ` Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  1 sibling, 1 reply; 84+ messages in thread

From: Tom Lane @ 2016-08-20 18:38 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>; pgsql-hackers

Robert Haas <robertmhaas@gmail.com> writes:
> Wow, nice results.  My intuition on why PGXACT helped in the first place was that it minimized the number of cache lines that had to be touched to take a snapshot. Padding obviously would somewhat increase that again, so I can't quite understand why it seems to be helping... any idea?

That's an interesting point.  I wonder whether this whole thing will be
useless or even counterproductive after (if) Heikki's CSN-snapshot patch
gets in.  I would certainly not mind reverting the PGXACT/PGPROC
separation if it proves no longer helpful after that.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-01-30 10:15     ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2017-01-30 10:15 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Robert Haas <robertmhaas@gmail.com>; pgsql-hackers

On Sat, Aug 20, 2016 at 9:38 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Robert Haas <robertmhaas@gmail.com> writes:
> > Wow, nice results.  My intuition on why PGXACT helped in the first place
> was that it minimized the number of cache lines that had to be touched to
> take a snapshot. Padding obviously would somewhat increase that again, so I
> can't quite understand why it seems to be helping... any idea?
>
> That's an interesting point.  I wonder whether this whole thing will be
> useless or even counterproductive after (if) Heikki's CSN-snapshot patch
> gets in.  I would certainly not mind reverting the PGXACT/PGPROC
> separation if it proves no longer helpful after that.
>

Assuming, we wouldn't realistically have CSN-snapshot patch committed to
10, I think we should consider PGXACT cache line alignment patch for 10.
Revision on PGXACT align patch is attached.  Now it doesn't introduce new
data structure for alignment, but uses manually calculated padding.  I
added static assertion that PGXACT is exactly PG_CACHE_LINE_SIZE because it
still have plenty of room for new fields before PG_CACHE_LINE_SIZE would be
exceeded.
Readonly pgbench results on 72 physically cores Intel server are attached.
It quite similar to results I posted before, but it's curious that
performance degradation of master on high concurrency became larger.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

pgxact-align-2.patch (application/octet-stream, 2.4K) download diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c new file mode 100644 index 1b836f7..3875687 *** a/src/backend/storage/lmgr/proc.c --- b/src/backend/storage/lmgr/proc.c *************** InitProcGlobal(void) *** 168,173 **** --- 168,176 ---- bool found; uint32 TotalProcs = MaxBackends + NUM_AUXILIARY_PROCS + max_prepared_xacts; + StaticAssertExpr(sizeof(PGXACT) == PG_CACHE_LINE_SIZE, + "PGXACT is not cacheline aligned"); + /* Create the ProcGlobal shared structure */ ProcGlobal = (PROC_HDR *) ShmemInitStruct("Proc Header", sizeof(PROC_HDR), &found); diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h new file mode 100644 index 398fa8a..7024369 *** a/src/include/storage/proc.h --- b/src/include/storage/proc.h *************** extern PGDLLIMPORT struct PGXACT *MyPgXa *** 187,197 **** /* * Prior to PostgreSQL 9.2, the fields below were stored as part of the * PGPROC. However, benchmarking revealed that packing these particular ! * members into a separate array as tightly as possible sped up GetSnapshotData ! * considerably on systems with many CPU cores, by reducing the number of ! * cache lines needing to be fetched. Thus, think very carefully before adding ! * anything else here. */ typedef struct PGXACT { TransactionId xid; /* id of top-level transaction currently being --- 187,204 ---- /* * Prior to PostgreSQL 9.2, the fields below were stored as part of the * PGPROC. However, benchmarking revealed that packing these particular ! * members into a separate array sped up GetSnapshotData considerably on ! * systems with many CPU cores, by reducing the number of cache lines needing ! * to be fetched. Also, this fields are subject of intensive writes even on ! * read-only workloads. This is why cache line alignment of them reduce cache ! * misses during GetSnapshotData and also gives considerable speedup on systems ! * with many CPU cores. */ + + /* Calculation of padding for PGXACT. Update this after changing of PGXACT. */ + #define PGXACTPadSize (PG_CACHE_LINE_SIZE - 2 * sizeof(TransactionId) \ + - 2 * sizeof(uint8) - 2 * sizeof(bool)) + typedef struct PGXACT { TransactionId xid; /* id of top-level transaction currently being *************** typedef struct PGXACT *** 209,214 **** --- 216,223 ---- * previously called InCommit */ uint8 nxids; + + char pad[PGXACTPadSize]; } PGXACT; /*
scalability-pgxact-align-2.png (image/png, 37.3K) download view image
^ permalink raw reply [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-02-10 23:28       ` Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-11 01:44         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-11 12:21         ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  0 siblings, 3 replies; 84+ messages in thread

From: Tomas Vondra @ 2017-02-10 23:28 UTC (permalink / raw)
  To: pgsql-hackers

Hi,

As discussed at the Developer meeting ~ a week ago, I've ran a number of 
benchmarks on the commit, on a small/medium-size x86 machines. I 
currently don't have access to a machine as big as used by Alexander 
(with 72 physical cores), but it seems useful to verify the patch does 
not have negative impact on smaller machines.

In particular I've ran these tests:

* r/o pgbench
* r/w pgbench
* 90% reads, 10% writes
* pgbench with skewed distribution
* pgbench with skewed distribution and skipping

And each of that with a number of clients, depending on the number of 
cores available. I've used the usual two boxes I use for all benchmarks, 
i.e. a small i5-2500k machine (8GB RAM, 4 cores), and a medium e5-2620v4 
box (32GB RAM, 16/32 cores).

Comparing averages of tps, measured on 5 runs (each 5 minutes long), the 
difference between master and patched master is usually within 2%, which 
is pretty much within noise.

I'm attaching spreadsheets with summary of the results, so that we have 
it in the archives. As usual, the scripts and much more detailed results 
are available here:

* e5-2620: https://bitbucket.org/tvondra/test-xact-alignment
* i5-2500k: https://bitbucket.org/tvondra/test-xact-alignment-i5

I do plan to run these results on the Power8 box I have access to, but 
that will have to wait for a bit, because it's currently doing something 
else.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

  xact-e5-2620.ods (application/vnd.oasis.opendocument.spreadsheet, 40.8K) download

  xact-i5-2500k.ods (application/vnd.oasis.opendocument.spreadsheet, 30.2K) download

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
@ 2017-02-11 01:44         ` Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-11 01:54           ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2 siblings, 1 reply; 84+ messages in thread

From: Ashutosh Sharma @ 2017-02-11 01:44 UTC (permalink / raw)
  To: Tomas Vondra <tomas.vondra@2ndquadrant.com>; +Cc: pgsql-hackers

Hi,

I am currently testing this patch on a large machine and will share the
test results in few days of time.

Please excuse any grammatical errors as I am using my mobile device. Thanks.

On Feb 11, 2017 04:59, "Tomas Vondra" <tomas.vondra@2ndquadrant.com> wrote:

> Hi,
>
> As discussed at the Developer meeting ~ a week ago, I've ran a number of
> benchmarks on the commit, on a small/medium-size x86 machines. I currently
> don't have access to a machine as big as used by Alexander (with 72
> physical cores), but it seems useful to verify the patch does not have
> negative impact on smaller machines.
>
> In particular I've ran these tests:
>
> * r/o pgbench
> * r/w pgbench
> * 90% reads, 10% writes
> * pgbench with skewed distribution
> * pgbench with skewed distribution and skipping
>
> And each of that with a number of clients, depending on the number of
> cores available. I've used the usual two boxes I use for all benchmarks,
> i.e. a small i5-2500k machine (8GB RAM, 4 cores), and a medium e5-2620v4
> box (32GB RAM, 16/32 cores).
>
> Comparing averages of tps, measured on 5 runs (each 5 minutes long), the
> difference between master and patched master is usually within 2%, which is
> pretty much within noise.
>
> I'm attaching spreadsheets with summary of the results, so that we have it
> in the archives. As usual, the scripts and much more detailed results are
> available here:
>
> * e5-2620: https://bitbucket.org/tvondra/test-xact-alignment
> * i5-2500k: https://bitbucket.org/tvondra/test-xact-alignment-i5
>
> I do plan to run these results on the Power8 box I have access to, but
> that will have to wait for a bit, because it's currently doing something
> else.
>
> regards
>
> --
> Tomas Vondra                  http://www.2ndQuadrant.com
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>
>

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-11 01:44         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
@ 2017-02-11 01:54           ` Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-11 14:04             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Tomas Vondra @ 2017-02-11 01:54 UTC (permalink / raw)
  To: Ashutosh Sharma <ashu.coek88@gmail.com>; +Cc: pgsql-hackers

On 02/11/2017 02:44 AM, Ashutosh Sharma wrote:
> Hi,
>
> I am currently testing this patch on a large machine and will share the
> test results in few days of time.
>

FWIW it might be interesting to have comparable results from the same 
benchmarks I did. The scripts available in the git repositories should 
not be that hard to tweak. Let me know if you're interested and need 
help with that.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-11 01:44         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-11 01:54           ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
@ 2017-02-11 14:04             ` Ashutosh Sharma <ashu.coek88@gmail.com>
  0 siblings, 0 replies; 84+ messages in thread

From: Ashutosh Sharma @ 2017-02-11 14:04 UTC (permalink / raw)
  To: Tomas Vondra <tomas.vondra@2ndquadrant.com>; +Cc: pgsql-hackers

> FWIW it might be interesting to have comparable results from the same
> benchmarks I did. The scripts available in the git repositories should not
> be that hard to tweak. Let me know if you're interested and need help with
> that.
>

Sure, I will have a look into those scripts once I am done with the
simple pgbench testing. Thanks and sorry for the delayed response.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
@ 2017-02-11 12:21         ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-11 13:17           ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2 siblings, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2017-02-11 12:21 UTC (permalink / raw)
  To: Tomas Vondra <tomas.vondra@2ndquadrant.com>; +Cc: pgsql-hackers

Hi, Tomas!

On Sat, Feb 11, 2017 at 2:28 AM, Tomas Vondra <tomas.vondra@2ndquadrant.com>
wrote:

> As discussed at the Developer meeting ~ a week ago, I've ran a number of
> benchmarks on the commit, on a small/medium-size x86 machines. I currently
> don't have access to a machine as big as used by Alexander (with 72
> physical cores), but it seems useful to verify the patch does not have
> negative impact on smaller machines.
>
> In particular I've ran these tests:
>
> * r/o pgbench
> * r/w pgbench
> * 90% reads, 10% writes
> * pgbench with skewed distribution
> * pgbench with skewed distribution and skipping
>

Thank you very much for your efforts!
I took a look at these tests.  One thing catch my eyes.  You warmup
database using pgbench run.  Did you consider using pg_prewarm instead?

SELECT sum(x.x) FROM (SELECT pg_prewarm(oid) AS x FROM pg_class WHERE
relkind IN ('i', 'r') ORDER BY oid) x;

In my experience pg_prewarm both takes less time and leaves less variation
afterwards.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-11 12:21         ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-02-11 13:17           ` Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-11 18:31             ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  0 siblings, 1 reply; 84+ messages in thread

From: Tomas Vondra @ 2017-02-11 13:17 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: pgsql-hackers

On 02/11/2017 01:21 PM, Alexander Korotkov wrote:
> Hi, Tomas!
>
> On Sat, Feb 11, 2017 at 2:28 AM, Tomas Vondra
> <tomas.vondra@2ndquadrant.com <mailto:tomas.vondra@2ndquadrant.com>> wrote:
>
>     As discussed at the Developer meeting ~ a week ago, I've ran a
>     number of benchmarks on the commit, on a small/medium-size x86
>     machines. I currently don't have access to a machine as big as used
>     by Alexander (with 72 physical cores), but it seems useful to verify
>     the patch does not have negative impact on smaller machines.
>
>     In particular I've ran these tests:
>
>     * r/o pgbench
>     * r/w pgbench
>     * 90% reads, 10% writes
>     * pgbench with skewed distribution
>     * pgbench with skewed distribution and skipping
>
>
> Thank you very much for your efforts!
> I took a look at these tests.  One thing catch my eyes.  You warmup
> database using pgbench run.  Did you consider using pg_prewarm instead?
>
> SELECT sum(x.x) FROM (SELECT pg_prewarm(oid) AS x FROM pg_class WHERE
> relkind IN ('i', 'r') ORDER BY oid) x;
>
> In my experience pg_prewarm both takes less time and leaves less
> variation afterwards.
>

I've considered it, but the problem I see in using pg_prewarm for 
benchmarking purposes is that it only loads the data into memory, but it 
does not modify the tuples (so all tuples have the same xmin/xmax, no 
dead tuples, ...), it does not set usage counters on the buffers and 
also does not generate any clog records.

I don't think there's a lot of variability in the results I measured. If 
you look at (max-min) for each combination of parameters, the delta is 
generally within 2% of average, with a very few exceptions, usually 
caused by the first run (so perhaps the warmup should be a bit longer).

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-11 12:21         ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-11 13:17           ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
@ 2017-02-11 18:31             ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  0 siblings, 0 replies; 84+ messages in thread

From: Alexander Korotkov @ 2017-02-11 18:31 UTC (permalink / raw)
  To: Tomas Vondra <tomas.vondra@2ndquadrant.com>; +Cc: pgsql-hackers

On Sat, Feb 11, 2017 at 4:17 PM, Tomas Vondra <tomas.vondra@2ndquadrant.com>
wrote:

> On 02/11/2017 01:21 PM, Alexander Korotkov wrote:
>
>> Hi, Tomas!
>>
>> On Sat, Feb 11, 2017 at 2:28 AM, Tomas Vondra
>> <tomas.vondra@2ndquadrant.com <mailto:tomas.vondra@2ndquadrant.com>>
>> wrote:
>>
>>     As discussed at the Developer meeting ~ a week ago, I've ran a
>>     number of benchmarks on the commit, on a small/medium-size x86
>>     machines. I currently don't have access to a machine as big as used
>>     by Alexander (with 72 physical cores), but it seems useful to verify
>>     the patch does not have negative impact on smaller machines.
>>
>>     In particular I've ran these tests:
>>
>>     * r/o pgbench
>>     * r/w pgbench
>>     * 90% reads, 10% writes
>>     * pgbench with skewed distribution
>>     * pgbench with skewed distribution and skipping
>>
>>
>> Thank you very much for your efforts!
>> I took a look at these tests.  One thing catch my eyes.  You warmup
>> database using pgbench run.  Did you consider using pg_prewarm instead?
>>
>> SELECT sum(x.x) FROM (SELECT pg_prewarm(oid) AS x FROM pg_class WHERE
>> relkind IN ('i', 'r') ORDER BY oid) x;
>>
>> In my experience pg_prewarm both takes less time and leaves less
>> variation afterwards.
>>
>>
> I've considered it, but the problem I see in using pg_prewarm for
> benchmarking purposes is that it only loads the data into memory, but it
> does not modify the tuples (so all tuples have the same xmin/xmax, no dead
> tuples, ...), it does not set usage counters on the buffers and also does
> not generate any clog records.
>

Yes, but please note that pgbench runs VACUUM first, and all the tuples
would be hinted.  In order to xmin/xmax and clog take effect, you should
run subsequent pgbench with --no-vacuum.  Also usage counters of buffers
make sense only when eviction happens, i.e. data don't fit shared_buffers.

Also, you use pgbench -S to warmup before readonly test.  I think
pg_prewarm would be much better there unless your data is bigger than
shared_buffers.

I don't think there's a lot of variability in the results I measured. If
> you look at (max-min) for each combination of parameters, the delta is
> generally within 2% of average, with a very few exceptions, usually caused
> by the first run (so perhaps the warmup should be a bit longer).


You also could run pg_prewarm before warmup pgbench for readwrite test.  In
my intuition you should get more stable results with shorter warmup.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
@ 2017-02-13 12:34         ` Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2 siblings, 1 reply; 84+ messages in thread

From: Bernd Helmle @ 2017-02-13 12:34 UTC (permalink / raw)
  To: Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Am Samstag, den 11.02.2017, 00:28 +0100 schrieb Tomas Vondra:
> Comparing averages of tps, measured on 5 runs (each 5 minutes long),
> the 
> difference between master and patched master is usually within 2%,
> which 
> is pretty much within noise.
> 
> I'm attaching spreadsheets with summary of the results, so that we
> have 
> it in the archives. As usual, the scripts and much more detailed
> results 
> are available here:

I've done some benchmarking of this patch against the E850/ppc64el
Ubuntu LPAR we currently have access to and got the attached results.
pg_prewarm as recommended by Alexander was used, the tests run 300s
secs, scale 1000, each with a testrun before. The SELECT-only pgbench
was run twice each, the write tests only once.

Looks like the influence of this patch isn't that big, at least on this
machine.

We're going to reassign the resources to an AIX LPAR soon, which
doesn't give me enough time to test with Tomas' test scripts again.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

bench.png (image/png, 6.0K) download view image
master-nopgxact-results.txt (text/plain, 2.8K) download >>>>>> clients 10 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 10 number of threads: 10 duration: 300 s number of transactions actually processed: 39931683 latency average = 0.075 ms tps = 133105.478637 (including connections establishing) tps = 133109.428803 (excluding connections establishing) >>>>>> clients 20 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 20 number of threads: 20 duration: 300 s number of transactions actually processed: 78852558 latency average = 0.076 ms tps = 262841.340316 (including connections establishing) tps = 262855.469408 (excluding connections establishing) >>>>>> clients 40 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 40 number of threads: 40 duration: 300 s number of transactions actually processed: 118612968 latency average = 0.101 ms tps = 395375.595262 (including connections establishing) tps = 395432.166071 (excluding connections establishing) >>>>>> clients 80 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 80 number of threads: 80 duration: 300 s number of transactions actually processed: 170171627 latency average = 0.141 ms tps = 567235.428660 (including connections establishing) tps = 567322.181229 (excluding connections establishing) >>>>>> clients 100 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 100 number of threads: 100 duration: 300 s number of transactions actually processed: 168267642 latency average = 0.178 ms tps = 560888.338862 (including connections establishing) tps = 561076.995776 (excluding connections establishing) >>>>>> clients 160 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 160 number of threads: 160 duration: 300 s number of transactions actually processed: 146675068 latency average = 0.327 ms tps = 488911.857866 (including connections establishing) tps = 489155.251547 (excluding connections establishing) >>>>>> clients 240 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 240 number of threads: 240 duration: 300 s number of transactions actually processed: 139558941 latency average = 0.516 ms tps = 465184.240782 (including connections establishing) tps = 466046.696168 (excluding connections establishing) >>>>>> clients 280 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 280 number of threads: 280 duration: 300 s number of transactions actually processed: 137419242 latency average = 0.611 ms tps = 458052.555736 (including connections establishing) tps = 459795.543770 (excluding connections establishing)
master-results-2.txt (text/plain, 2.8K) download >>>>>> clients 10 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 10 number of threads: 10 duration: 300 s number of transactions actually processed: 40994263 latency average = 0.073 ms tps = 136647.383534 (including connections establishing) tps = 136649.850380 (excluding connections establishing) >>>>>> clients 20 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 20 number of threads: 20 duration: 300 s number of transactions actually processed: 71023846 latency average = 0.084 ms tps = 236745.708077 (including connections establishing) tps = 236752.743230 (excluding connections establishing) >>>>>> clients 40 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 40 number of threads: 40 duration: 300 s number of transactions actually processed: 120060357 latency average = 0.100 ms tps = 400200.095159 (including connections establishing) tps = 400238.563079 (excluding connections establishing) >>>>>> clients 80 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 80 number of threads: 80 duration: 300 s number of transactions actually processed: 170353955 latency average = 0.141 ms tps = 567843.510912 (including connections establishing) tps = 567913.555324 (excluding connections establishing) >>>>>> clients 100 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 100 number of threads: 100 duration: 300 s number of transactions actually processed: 169034944 latency average = 0.177 ms tps = 563445.359606 (including connections establishing) tps = 563570.002605 (excluding connections establishing) >>>>>> clients 160 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 160 number of threads: 160 duration: 300 s number of transactions actually processed: 148999446 latency average = 0.322 ms tps = 496658.855942 (including connections establishing) tps = 496881.446812 (excluding connections establishing) >>>>>> clients 240 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 240 number of threads: 240 duration: 300 s number of transactions actually processed: 140925134 latency average = 0.511 ms tps = 469741.966734 (including connections establishing) tps = 470315.112372 (excluding connections establishing) >>>>>> clients 280 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 280 number of threads: 280 duration: 300 s number of transactions actually processed: 138396584 latency average = 0.607 ms tps = 461311.366272 (including connections establishing) tps = 463616.087068 (excluding connections establishing)
master-result-writes.txt (text/plain, 2.8K) download >>>>>> clients 10 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 10 number of threads: 10 duration: 300 s number of transactions actually processed: 2376419 latency average = 1.262 ms tps = 7921.371808 (including connections establishing) tps = 7921.599824 (excluding connections establishing) >>>>>> clients 20 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 20 number of threads: 20 duration: 300 s number of transactions actually processed: 3780657 latency average = 1.587 ms tps = 12602.156420 (including connections establishing) tps = 12603.071942 (excluding connections establishing) >>>>>> clients 40 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 40 number of threads: 40 duration: 300 s number of transactions actually processed: 6510537 latency average = 1.843 ms tps = 21701.669930 (including connections establishing) tps = 21704.812043 (excluding connections establishing) >>>>>> clients 80 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 80 number of threads: 80 duration: 300 s number of transactions actually processed: 9090812 latency average = 2.640 ms tps = 30302.301679 (including connections establishing) tps = 30308.205764 (excluding connections establishing) >>>>>> clients 100 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 100 number of threads: 100 duration: 300 s number of transactions actually processed: 9472741 latency average = 3.167 ms tps = 31574.679938 (including connections establishing) tps = 31579.444172 (excluding connections establishing) >>>>>> clients 160 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 160 number of threads: 160 duration: 300 s number of transactions actually processed: 9502487 latency average = 5.051 ms tps = 31674.382349 (including connections establishing) tps = 31684.734690 (excluding connections establishing) >>>>>> clients 240 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 240 number of threads: 240 duration: 300 s number of transactions actually processed: 7450455 latency average = 9.664 ms tps = 24833.638729 (including connections establishing) tps = 24866.521521 (excluding connections establishing) >>>>>> clients 280 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 280 number of threads: 280 duration: 300 s number of transactions actually processed: 7343432 latency average = 11.439 ms tps = 24477.045555 (including connections establishing) tps = 24523.738599 (excluding connections establishing)
pgxact-result-2.txt (text/plain, 2.9K) download >>>>>> clients 10 <<<<< >>>>>> clients 10 <<<<< >>>>>> clients 10 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 10 number of threads: 10 duration: 300 s number of transactions actually processed: 42570775 latency average = 0.070 ms tps = 141902.402572 (including connections establishing) tps = 141905.765836 (excluding connections establishing) >>>>>> clients 20 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 20 number of threads: 20 duration: 300 s number of transactions actually processed: 69598432 latency average = 0.086 ms tps = 231994.360354 (including connections establishing) tps = 232002.040845 (excluding connections establishing) >>>>>> clients 40 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 40 number of threads: 40 duration: 300 s number of transactions actually processed: 116205237 latency average = 0.103 ms tps = 387349.752493 (including connections establishing) tps = 387366.529481 (excluding connections establishing) >>>>>> clients 80 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 80 number of threads: 80 duration: 300 s number of transactions actually processed: 142393812 latency average = 0.169 ms tps = 474643.805983 (including connections establishing) tps = 474704.059451 (excluding connections establishing) >>>>>> clients 100 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 100 number of threads: 100 duration: 300 s number of transactions actually processed: 125610112 latency average = 0.239 ms tps = 418697.479634 (including connections establishing) tps = 418937.082310 (excluding connections establishing) >>>>>> clients 160 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 160 number of threads: 160 duration: 300 s number of transactions actually processed: 114689712 latency average = 0.419 ms tps = 382294.115170 (including connections establishing) tps = 382395.473453 (excluding connections establishing) >>>>>> clients 240 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 240 number of threads: 240 duration: 300 s number of transactions actually processed: 109239029 latency average = 0.659 ms tps = 364123.541809 (including connections establishing) tps = 364752.037236 (excluding connections establishing) >>>>>> clients 280 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 280 number of threads: 280 duration: 300 s number of transactions actually processed: 107034818 latency average = 0.785 ms tps = 356775.751968 (including connections establishing) tps = 359363.706718 (excluding connections establishing)
pgxact-results.txt (text/plain, 2.8K) download >>>>>> clients 10 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 10 number of threads: 10 duration: 300 s number of transactions actually processed: 45627582 latency average = 0.066 ms tps = 152091.770667 (including connections establishing) tps = 152096.366710 (excluding connections establishing) >>>>>> clients 20 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 20 number of threads: 20 duration: 300 s number of transactions actually processed: 66172223 latency average = 0.091 ms tps = 220573.717021 (including connections establishing) tps = 220586.814190 (excluding connections establishing) >>>>>> clients 40 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 40 number of threads: 40 duration: 300 s number of transactions actually processed: 113634167 latency average = 0.106 ms tps = 378779.664593 (including connections establishing) tps = 378893.034797 (excluding connections establishing) >>>>>> clients 80 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 80 number of threads: 80 duration: 300 s number of transactions actually processed: 172374274 latency average = 0.139 ms tps = 574577.756142 (including connections establishing) tps = 574844.952169 (excluding connections establishing) >>>>>> clients 100 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 100 number of threads: 100 duration: 300 s number of transactions actually processed: 167731389 latency average = 0.179 ms tps = 559100.559440 (including connections establishing) tps = 559336.298386 (excluding connections establishing) >>>>>> clients 160 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 160 number of threads: 160 duration: 300 s number of transactions actually processed: 146283835 latency average = 0.328 ms tps = 487606.202533 (including connections establishing) tps = 488246.917550 (excluding connections establishing) >>>>>> clients 240 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 240 number of threads: 240 duration: 300 s number of transactions actually processed: 138362898 latency average = 0.520 ms tps = 461202.582779 (including connections establishing) tps = 461572.236905 (excluding connections establishing) >>>>>> clients 280 <<<<< transaction type: <builtin: select only> scaling factor: 1000 query mode: prepared number of clients: 280 number of threads: 280 duration: 300 s number of transactions actually processed: 135880075 latency average = 0.618 ms tps = 452926.221920 (including connections establishing) tps = 455713.547955 (excluding connections establishing)
pgxact-result-writes.txt (text/plain, 2.8K) download >>>>>> clients 10 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 10 number of threads: 10 duration: 300 s number of transactions actually processed: 2449170 latency average = 1.225 ms tps = 8163.869128 (including connections establishing) tps = 8164.067544 (excluding connections establishing) >>>>>> clients 20 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 20 number of threads: 20 duration: 300 s number of transactions actually processed: 4238474 latency average = 1.416 ms tps = 14128.175200 (including connections establishing) tps = 14129.267287 (excluding connections establishing) >>>>>> clients 40 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 40 number of threads: 40 duration: 300 s number of transactions actually processed: 6651686 latency average = 1.804 ms tps = 22172.136448 (including connections establishing) tps = 22174.550274 (excluding connections establishing) >>>>>> clients 80 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 80 number of threads: 80 duration: 300 s number of transactions actually processed: 9214139 latency average = 2.605 ms tps = 30713.483239 (including connections establishing) tps = 30719.046662 (excluding connections establishing) >>>>>> clients 100 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 100 number of threads: 100 duration: 300 s number of transactions actually processed: 9667045 latency average = 3.103 ms tps = 32223.080081 (including connections establishing) tps = 32229.692645 (excluding connections establishing) >>>>>> clients 160 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 160 number of threads: 160 duration: 300 s number of transactions actually processed: 10019567 latency average = 4.791 ms tps = 33397.557559 (including connections establishing) tps = 33409.512729 (excluding connections establishing) >>>>>> clients 240 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 240 number of threads: 240 duration: 300 s number of transactions actually processed: 7987615 latency average = 9.014 ms tps = 26624.593507 (including connections establishing) tps = 26636.808641 (excluding connections establishing) >>>>>> clients 280 <<<<< transaction type: <builtin: TPC-B (sort of)> scaling factor: 1000 query mode: prepared number of clients: 280 number of threads: 280 duration: 300 s number of transactions actually processed: 7015519 latency average = 11.974 ms tps = 23384.304471 (including connections establishing) tps = 23415.194033 (excluding connections establishing)
^ permalink raw reply [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
@ 2017-02-13 13:55           ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  0 siblings, 2 replies; 84+ messages in thread

From: Alexander Korotkov @ 2017-02-13 13:55 UTC (permalink / raw)
  To: Bernd Helmle <mailings@oopsware.de>; +Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Mon, Feb 13, 2017 at 3:34 PM, Bernd Helmle <mailings@oopsware.de> wrote:

> Am Samstag, den 11.02.2017, 00:28 +0100 schrieb Tomas Vondra:
> > Comparing averages of tps, measured on 5 runs (each 5 minutes long),
> > the
> > difference between master and patched master is usually within 2%,
> > which
> > is pretty much within noise.
> >
> > I'm attaching spreadsheets with summary of the results, so that we
> > have
> > it in the archives. As usual, the scripts and much more detailed
> > results
> > are available here:
>
> I've done some benchmarking of this patch against the E850/ppc64el
> Ubuntu LPAR we currently have access to and got the attached results.
> pg_prewarm as recommended by Alexander was used, the tests run 300s
> secs, scale 1000, each with a testrun before. The SELECT-only pgbench
> was run twice each, the write tests only once.
>
> Looks like the influence of this patch isn't that big, at least on this
> machine.
>

Thank you for testing.

Yes, influence seems to be low.  But nevertheless it's important to insure
that there is no regression here.
Despite pg_prewarm'ing and running tests 300s, there is still significant
variation.
For instance, with clients count = 80:
 * pgxact-result-2.txt – 474704
 * pgxact-results.txt – 574844
Could some background processes influence the tests?  Or could it be
another virtual machine?
Also, I wonder why I can't see this variation on the graphs.
Another issue with graphs is that we can't see details of read and write
TPS variation on the same scale, because write TPS values are too low.  I
think you should draw write benchmark on the separate graph.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-02-13 16:07             ` Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-14 12:00               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 16:43               ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  1 sibling, 2 replies; 84+ messages in thread

From: Alvaro Herrera @ 2017-02-13 16:07 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Alexander Korotkov wrote:

> Yes, influence seems to be low.  But nevertheless it's important to insure
> that there is no regression here.
> Despite pg_prewarm'ing and running tests 300s, there is still significant
> variation.
> For instance, with clients count = 80:
>  * pgxact-result-2.txt – 474704
>  * pgxact-results.txt – 574844
> Could some background processes influence the tests?  Or could it be
> another virtual machine?
> Also, I wonder why I can't see this variation on the graphs.
> Another issue with graphs is that we can't see details of read and write
> TPS variation on the same scale, because write TPS values are too low.  I
> think you should draw write benchmark on the separate graph.

So, I'm reading that on PPC64 there is no effect, and on the "lesser"
machine Tomas tested on, there is no effect either; this patch only
seems to benefit Alexander's 72 core x86_64 machine.

It seems to me that Andres comments here were largely ignored:
https://www.postgresql.org/message-id/20160822021747.u5bqx2xwwjzac5u5@alap3.anarazel.de
He was suggesting to increase the struct size to 16 bytes rather than
going all the way up to 128.  Did anybody test this?

Re the coding of the padding computation, seems it'd be better to use
our standard "offsetof(last-struct-member) + sizeof(last-struct-member)"
rather than adding each of the members' sizes individually.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2017-02-14 12:00               ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-14 12:57                 ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  1 sibling, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2017-02-14 12:00 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Mon, Feb 13, 2017 at 7:07 PM, Alvaro Herrera <alvherre@2ndquadrant.com>
wrote:

> Alexander Korotkov wrote:
>
> > Yes, influence seems to be low.  But nevertheless it's important to
> insure
> > that there is no regression here.
> > Despite pg_prewarm'ing and running tests 300s, there is still significant
> > variation.
> > For instance, with clients count = 80:
> >  * pgxact-result-2.txt – 474704
> >  * pgxact-results.txt – 574844
> > Could some background processes influence the tests?  Or could it be
> > another virtual machine?
> > Also, I wonder why I can't see this variation on the graphs.
> > Another issue with graphs is that we can't see details of read and write
> > TPS variation on the same scale, because write TPS values are too low.  I
> > think you should draw write benchmark on the separate graph.
>
> So, I'm reading that on PPC64 there is no effect, and on the "lesser"
> machine Tomas tested on, there is no effect either; this patch only
> seems to benefit Alexander's 72 core x86_64 machine.
>
> It seems to me that Andres comments here were largely ignored:
> https://www.postgresql.org/message-id/20160822021747.
> u5bqx2xwwjzac5u5@alap3.anarazel.de
> He was suggesting to increase the struct size to 16 bytes rather than
> going all the way up to 128.  Did anybody test this?
>

Thank you for pointing.  I'll provide such version of patch and test it on
72 core x86_64 machine.


> Re the coding of the padding computation, seems it'd be better to use
> our standard "offsetof(last-struct-member) + sizeof(last-struct-member)"
> rather than adding each of the members' sizes individually.
>

It was done so in order to evade extra level of nesting for PGXACT.  See
discussion with Tom Lane in [1] and upthread.
Do you think we should introduce extra level of nesting or have better
ideas about how to evade it?

1. https://www.postgresql.org/message-id/19065.1471621560%40sss.pgh.pa.us

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-14 12:00               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-02-14 12:57                 ` Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-14 13:06                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  0 siblings, 1 reply; 84+ messages in thread

From: Alvaro Herrera @ 2017-02-14 12:57 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Alexander Korotkov wrote:
> On Mon, Feb 13, 2017 at 7:07 PM, Alvaro Herrera <alvherre@2ndquadrant.com>
> wrote:

> > Re the coding of the padding computation, seems it'd be better to use
> > our standard "offsetof(last-struct-member) + sizeof(last-struct-member)"
> > rather than adding each of the members' sizes individually.
> 
> It was done so in order to evade extra level of nesting for PGXACT.  See
> discussion with Tom Lane in [1] and upthread.

Yes, I understand.  I just mean that it could be done something like
this:

#define PGXACTPadSize (PG_CACHE_LINE_SIZE - (offsetof(PGXACT, nxid) + sizeof(uint8)))

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-14 12:00               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-14 12:57                 ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2017-02-14 13:06                   ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-14 14:13                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2017-02-14 13:06 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Tue, Feb 14, 2017 at 3:57 PM, Alvaro Herrera <alvherre@2ndquadrant.com>
wrote:

> Alexander Korotkov wrote:
> > On Mon, Feb 13, 2017 at 7:07 PM, Alvaro Herrera <
> alvherre@2ndquadrant.com>
> > wrote:
>
> > > Re the coding of the padding computation, seems it'd be better to use
> > > our standard "offsetof(last-struct-member) +
> sizeof(last-struct-member)"
> > > rather than adding each of the members' sizes individually.
> >
> > It was done so in order to evade extra level of nesting for PGXACT.  See
> > discussion with Tom Lane in [1] and upthread.
>
> Yes, I understand.  I just mean that it could be done something like
> this:
>
> #define PGXACTPadSize (PG_CACHE_LINE_SIZE - (offsetof(PGXACT, nxid) +
> sizeof(uint8)))


Yes, but I can't use such macro in the definition of PGXACT itself.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-14 12:00               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-14 12:57                 ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-14 13:06                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-02-14 14:13                     ` Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 0 replies; 84+ messages in thread

From: Alvaro Herrera @ 2017-02-14 14:13 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Alexander Korotkov wrote:
> On Tue, Feb 14, 2017 at 3:57 PM, Alvaro Herrera <alvherre@2ndquadrant.com>
> wrote:

> > Yes, I understand.  I just mean that it could be done something like
> > this:
> >
> > #define PGXACTPadSize (PG_CACHE_LINE_SIZE - (offsetof(PGXACT, nxid) +
> > sizeof(uint8)))
> 
> Yes, but I can't use such macro in the definition of PGXACT itself.

/me slaps forehead

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2017-02-15 16:43               ` Robert Haas <robertmhaas@gmail.com>
  2017-02-15 17:14                 ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-02-15 19:15                 ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  1 sibling, 2 replies; 84+ messages in thread

From: Robert Haas @ 2017-02-15 16:43 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Mon, Feb 13, 2017 at 11:07 AM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> It seems to me that Andres comments here were largely ignored:
> https://www.postgresql.org/message-id/20160822021747.u5bqx2xwwjzac5u5@alap3.anarazel.de
> He was suggesting to increase the struct size to 16 bytes rather than
> going all the way up to 128.  Did anybody test this?

So, I think that going up to 128 bytes can't really make sense.  If
that's the best-performing solution here, then maybe what we ought to
be doing is reverting the PGXACT/PGPROC separation, sticking these
critical members at the beginning, and padding the whole PGXACT out to
a multiple of the cache line size.  Something that only touches the
PGXACT fields will touch the exact same number of cache lines with
that design, but cases that touch more than just the PGXACT fields
should perform better.  The point of moving PGXACT into a separate
structure was to reduce the number of cache lines required to build a
snapshot.  If that's going to go back up to 1 per PGPROC anyway, we
might as well at least use the rest of that cache line to store
something else that might be useful instead of pad bytes.  I think,
anyway.

If padding to 16 bytes is sufficient to get the performance
improvement (or as much as we care about), that seems more reasonable.
But it's still possible we may be gaining on one hand (because now
you'll never touch multiple cache lines for your own PGXACT) and
losing on the other (because now you're scanning 4/3 as many cache
lines to construct a snapshot).  Which of those is better might be
workload-dependent or hardware-dependent.

> Re the coding of the padding computation, seems it'd be better to use
> our standard "offsetof(last-struct-member) + sizeof(last-struct-member)"
> rather than adding each of the members' sizes individually.

I think our now-standard way of doing this is to have a "Padded"
version that is a union between the unpadded struct and char[].  c.f.
BufferDescPadded, LWLockPadded.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-15 16:43               ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
@ 2017-02-15 17:14                 ` Tom Lane <tgl@sss.pgh.pa.us>
  2017-02-15 17:24                   ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  1 sibling, 1 reply; 84+ messages in thread

From: Tom Lane @ 2017-02-15 17:14 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Feb 13, 2017 at 11:07 AM, Alvaro Herrera
> <alvherre@2ndquadrant.com> wrote:
>> It seems to me that Andres comments here were largely ignored:
>> https://www.postgresql.org/message-id/20160822021747.u5bqx2xwwjzac5u5@alap3.anarazel.de
>> He was suggesting to increase the struct size to 16 bytes rather than
>> going all the way up to 128.  Did anybody test this?

> So, I think that going up to 128 bytes can't really make sense.  If
> that's the best-performing solution here, then maybe what we ought to
> be doing is reverting the PGXACT/PGPROC separation, sticking these
> critical members at the beginning, and padding the whole PGXACT out to
> a multiple of the cache line size.

Yes.  That separation was never more than a horribly ugly kluge.
I would love to see it go away.  But keeping it *and* padding
PGXACT to something >= the size of PGPROC borders on insanity.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-15 16:43               ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-15 17:14                 ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-02-15 17:24                   ` Robert Haas <robertmhaas@gmail.com>
  2017-02-15 17:48                     ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-02-15 19:23                     ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  0 siblings, 2 replies; 84+ messages in thread

From: Robert Haas @ 2017-02-15 17:24 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Wed, Feb 15, 2017 at 12:14 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Mon, Feb 13, 2017 at 11:07 AM, Alvaro Herrera
>> <alvherre@2ndquadrant.com> wrote:
>>> It seems to me that Andres comments here were largely ignored:
>>> https://www.postgresql.org/message-id/20160822021747.u5bqx2xwwjzac5u5@alap3.anarazel.de
>>> He was suggesting to increase the struct size to 16 bytes rather than
>>> going all the way up to 128.  Did anybody test this?
>
>> So, I think that going up to 128 bytes can't really make sense.  If
>> that's the best-performing solution here, then maybe what we ought to
>> be doing is reverting the PGXACT/PGPROC separation, sticking these
>> critical members at the beginning, and padding the whole PGXACT out to
>> a multiple of the cache line size.
>
> Yes.  That separation was never more than a horribly ugly kluge.
> I would love to see it go away.  But keeping it *and* padding
> PGXACT to something >= the size of PGPROC borders on insanity.

I don't think it would be bigger than a PGPROC.  PGPROCs are really
big, 816 bytes on my MacBook Pro.  But if you did what I suggested,
you could take a snapshot by touching 1 cache line per backend.  They
wouldn't be consecutive; it would be an upward pattern, with skips.
If you pad PGXACT out to one cache line, you could likewise take a
snapshot by touching 1 cache line per backend, and they'd be
consecutive.  Maybe that difference matters to the memory prefetching
controller, I dunno, but it seems funny that we did the PGXACT work to
reduce the number of cache lines that had to be touched in order to
take a snapshot to improve performance, and now we're talking about
increasing it again, also to improve performance.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-15 16:43               ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-15 17:14                 ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-02-15 17:24                   ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
@ 2017-02-15 17:48                     ` Tom Lane <tgl@sss.pgh.pa.us>
  2017-02-15 18:01                       ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  1 sibling, 1 reply; 84+ messages in thread

From: Tom Lane @ 2017-02-15 17:48 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Robert Haas <robertmhaas@gmail.com> writes:
> ... Maybe that difference matters to the memory prefetching
> controller, I dunno, but it seems funny that we did the PGXACT work to
> reduce the number of cache lines that had to be touched in order to
> take a snapshot to improve performance, and now we're talking about
> increasing it again, also to improve performance.

Yes.  I was skeptical that the original change was adequately proven
to be a good idea, and I'm even more skeptical this time.  I think
every single number that's been reported about this is completely
machine-specific, and likely workload-specific too, and should not
be taken as a reason to do anything.

My druthers at this point would be to revert the separation on code
cleanliness grounds and call it a day, more or less independently of any
claims about performance.  I'd be willing to talk about padding PGPROC
to some reasonable stride, but I remain dubious that any changes of
that sort would have a half-life worth complicating the code for.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-15 16:43               ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-15 17:14                 ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-02-15 17:24                   ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-15 17:48                     ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-02-15 18:01                       ` Robert Haas <robertmhaas@gmail.com>
  0 siblings, 0 replies; 84+ messages in thread

From: Robert Haas @ 2017-02-15 18:01 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Wed, Feb 15, 2017 at 12:48 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> ... Maybe that difference matters to the memory prefetching
>> controller, I dunno, but it seems funny that we did the PGXACT work to
>> reduce the number of cache lines that had to be touched in order to
>> take a snapshot to improve performance, and now we're talking about
>> increasing it again, also to improve performance.
>
> Yes.  I was skeptical that the original change was adequately proven
> to be a good idea, and I'm even more skeptical this time.  I think
> every single number that's been reported about this is completely
> machine-specific, and likely workload-specific too, and should not
> be taken as a reason to do anything.

The original change definitely worked on read-only pgbench workloads
on both x86 and Itanium, and the gains were pretty significant at
higher client counts.  I don't know whether we tested POWER.
Read-only pgbench throughput is not the world, of course, but it's a
reasonable proxy for high-concurrency, read-mostly workloads involving
short transactions, so it's not nothing, either.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-15 16:43               ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-15 17:14                 ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-02-15 17:24                   ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
@ 2017-02-15 19:23                     ` Andres Freund <andres@anarazel.de>
  1 sibling, 0 replies; 84+ messages in thread

From: Andres Freund @ 2017-02-15 19:23 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Hi,

On 2017-02-15 12:24:44 -0500, Robert Haas wrote:
> If you pad PGXACT out to one cache line, you could likewise take a
> snapshot by touching 1 cache line per backend, and they'd be
> consecutive.  Maybe that difference matters to the memory prefetching
> controller, I dunno,

Unfortunately it's currently *not* consecutively accessed afaik.  We're
not iterating PGXACT sequentially, we're doing it in pgprocno order.
The reason is that otherwise we have to scan unused PGXACT entries.

I've previously played around with using actual sequential access, and
it was a good bit faster as long as nearly all connections are used -
but slower when only a few are in use, which is quite common...


> but it seems funny that we did the PGXACT work to
> reduce the number of cache lines that had to be touched in order to
> take a snapshot to improve performance, and now we're talking about
> increasing it again, also to improve performance.

I don't think it's that weird that aligning things properly is important
for performance, nor that reducing the amount of memory accessed is
beneficial.  Engineering is tradeoffs, and we might just have erred a
bit too far in this case.

Greetings,

Andres Freund


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-15 16:43               ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
@ 2017-02-15 19:15                 ` Andres Freund <andres@anarazel.de>
  2017-02-15 19:38                   ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-20 12:32                   ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  1 sibling, 2 replies; 84+ messages in thread

From: Andres Freund @ 2017-02-15 19:15 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Hi,

On 2017-02-15 11:43:17 -0500, Robert Haas wrote:
> On Mon, Feb 13, 2017 at 11:07 AM, Alvaro Herrera
> <alvherre@2ndquadrant.com> wrote:
> > It seems to me that Andres comments here were largely ignored:
> > https://www.postgresql.org/message-id/20160822021747.u5bqx2xwwjzac5u5@alap3.anarazel.de
> > He was suggesting to increase the struct size to 16 bytes rather than
> > going all the way up to 128.  Did anybody test this?
> 
> So, I think that going up to 128 bytes can't really make sense.  If
> that's the best-performing solution here, then maybe what we ought to
> be doing is reverting the PGXACT/PGPROC separation, sticking these
> critical members at the beginning, and padding the whole PGXACT out to
> a multiple of the cache line size.  Something that only touches the
> PGXACT fields will touch the exact same number of cache lines with
> that design, but cases that touch more than just the PGXACT fields
> should perform better.

I don't think that's true for several reasons.  Separating out PGXACT
didn't just mean reducing the stride size of the access / preventing
sharing. It also meant that frequently changing fields in PGPROC aren't
on the same cache-line as fields in PGXACT.  That makes quite a
difference, because with the split a lot of the cachelines "backing"
PGPROC can stay in 'shared' mode in several CPU caches, while
modifications to PGPROC largely can stay in 'exclusive' mode locally on
the CPU the backend is currently running on.  I think I previously
mentioned, even just removing the MyPgXact->xmin assignment in
SnapshotResetXmin() is measurable performance wise and cache-hit ratio
wise.

While Nasby is right that going to multiple of the actual line size can
cause problems due to the N-way associativity of caches, it's not like
unused padding memory >= cacheline-size actually causes cache to be
wasted; it just gets used for other things.


FWIW, I however think we should just set the cacheline size based on the
architecture, rather than defaulting to 128 - it's not like that
actually changes particularly frequently.  I doubt a special-case for
each of x86, arm, power, itanium, and the rest will cause us a lot of
maintenance issues.


> The point of moving PGXACT into a separate
> structure was to reduce the number of cache lines required to build a
> snapshot.  If that's going to go back up to 1 per PGPROC anyway, we
> might as well at least use the rest of that cache line to store
> something else that might be useful instead of pad bytes.  I think,
> anyway.

I don't think that's true, due to the aforementioned dirtyness issue,
which causes inter-node cache coherency traffic (busier bus & latency).

> I think our now-standard way of doing this is to have a "Padded"
> version that is a union between the unpadded struct and char[].  c.f.
> BufferDescPadded, LWLockPadded.

That's what my original POC patch did IIRC, but somebody complained it
changed a lot of accesses.

- Andres


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-15 16:43               ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-15 19:15                 ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
@ 2017-02-15 19:38                   ` Robert Haas <robertmhaas@gmail.com>
  1 sibling, 0 replies; 84+ messages in thread

From: Robert Haas @ 2017-02-15 19:38 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Wed, Feb 15, 2017 at 2:15 PM, Andres Freund <andres@anarazel.de> wrote:
> I don't think that's true for several reasons.  Separating out PGXACT
> didn't just mean reducing the stride size of the access / preventing
> sharing. It also meant that frequently changing fields in PGPROC aren't
> on the same cache-line as fields in PGXACT.  That makes quite a
> difference, because with the split a lot of the cachelines "backing"
> PGPROC can stay in 'shared' mode in several CPU caches, while
> modifications to PGPROC largely can stay in 'exclusive' mode locally on
> the CPU the backend is currently running on.  I think I previously
> mentioned, even just removing the MyPgXact->xmin assignment in
> SnapshotResetXmin() is measurable performance wise and cache-hit ratio
> wise.

Oh, hmm.  I didn't think about that angle.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-15 16:43               ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-15 19:15                 ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
@ 2017-02-20 12:32                   ` Simon Riggs <simon@2ndquadrant.com>
  2017-02-20 16:53                     ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  1 sibling, 1 reply; 84+ messages in thread

From: Simon Riggs @ 2017-02-20 12:32 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Robert Haas <robertmhaas@gmail.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On 15 February 2017 at 19:15, Andres Freund <andres@anarazel.de> wrote:

> I think I previously
> mentioned, even just removing the MyPgXact->xmin assignment in
> SnapshotResetXmin() is measurable performance wise and cache-hit ratio
> wise.

Currently, we issue SnapshotResetXmin() pointlessly at end of xact, so
patch attached to remove that call, plus some comments to explain
that. This reduces the cause.

Also, another patch to reduce the calls to SnapshotResetXmin() using a
simple heuristic to reduce the effects.

-- 
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments: download all (2 files, .tar.gz)

skip_SnapshotResetXmin_if_idle_timeout.v1.patch (application/octet-stream, 1.0K) download diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 92afc32..b0b0a8d 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -979,6 +979,14 @@ SnapshotResetXmin(void) if (pairingheap_is_empty(&RegisteredSnapshots)) { + /* + * PgXact->xmin access bottlenecks on larger servers, so we choose + * to skip this if we have reason to believe that the xmin would not + * be long-lived such as when idle_in_transaction_timeout is set. + */ + if (IdleInTransactionSessionTimeout > 0) + return; + MyPgXact->xmin = InvalidTransactionId; return; } diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h index 2618cc4..828a257 100644 --- a/src/include/utils/snapmgr.h +++ b/src/include/utils/snapmgr.h @@ -47,7 +47,7 @@ /* GUC variables */ extern PGDLLIMPORT int old_snapshot_threshold; - +extern int IdleInTransactionSessionTimeout; /* copied from proc.h for convenience */ extern Size SnapMgrShmemSize(void); extern void SnapMgrInit(void);
reduce_pgxact_access_AtEOXact.v1.patch (application/octet-stream, 3.4K) download diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 82f9a3c..720b60a 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -2135,7 +2135,7 @@ CommitTransaction(void) AtEOXact_ComboCid(); AtEOXact_HashTables(true); AtEOXact_PgStat(true); - AtEOXact_Snapshot(true); + AtEOXact_Snapshot(true, false); AtCommit_ApplyLauncher(); pgstat_report_xact_timestamp(0); @@ -2407,7 +2407,7 @@ PrepareTransaction(void) AtEOXact_ComboCid(); AtEOXact_HashTables(true); /* don't call AtEOXact_PgStat here; we fixed pgstat state above */ - AtEOXact_Snapshot(true); + AtEOXact_Snapshot(true, true); pgstat_report_xact_timestamp(0); CurrentResourceOwner = NULL; @@ -2638,7 +2638,7 @@ CleanupTransaction(void) * do abort cleanup processing */ AtCleanup_Portals(); /* now safe to release portal memory */ - AtEOXact_Snapshot(false); /* and release the transaction's snapshots */ + AtEOXact_Snapshot(false, false); /* and release the transaction's snapshots */ CurrentResourceOwner = NULL; /* and resource owner */ if (TopTransactionResourceOwner) diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 92afc32..c650456 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -954,7 +954,12 @@ xmin_cmp(const pairingheap_node *a, const pairingheap_node *b, void *arg) * * If there are no more snapshots, we can reset our PGXACT->xmin to InvalidXid. * Note we can do this without locking because we assume that storing an Xid - * is atomic. + * is atomic. We do this because it will allow multi-statement transactions to + * reset their xmin and prevent us from holding back removal of dead rows; + * this has little purpose when we are dealing with very fast statements in + * read committed mode since the xmin will advance quickly anyway. It has no + * use at all when we are running single statement transactions since the xmin + * is reset as part of end of transaction anyway. * * Even if there are some remaining snapshots, we may be able to advance our * PGXACT->xmin to some degree. This typically happens when a portal is @@ -1051,7 +1064,7 @@ AtSubAbort_Snapshot(int level) * Snapshot manager's cleanup function for end of transaction */ void -AtEOXact_Snapshot(bool isCommit) +AtEOXact_Snapshot(bool isCommit, bool isPrepare) { /* * In transaction-snapshot mode we must release our privately-managed @@ -1136,7 +1149,15 @@ AtEOXact_Snapshot(bool isCommit) FirstSnapshotSet = false; - SnapshotResetXmin(); + /* + * For commit and abort AtEOXact_Snapshot() is called after the xmin + * has already cleared in the ProcArray, so there is no need at all to + * call SnapshotResetXmin() at this point unless we are preparing. + */ + if (isPrepare) + SnapshotResetXmin(); + + Assert(MyPgXact->xmin == 0); } diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h index 2618cc4..6899458 100644 --- a/src/include/utils/snapmgr.h +++ b/src/include/utils/snapmgr.h @@ -85,7 +85,7 @@ extern void UnregisterSnapshotFromOwner(Snapshot snapshot, ResourceOwner owner); extern void AtSubCommit_Snapshot(int level); extern void AtSubAbort_Snapshot(int level); -extern void AtEOXact_Snapshot(bool isCommit); +extern void AtEOXact_Snapshot(bool isCommit, bool isPrepare); extern void ImportSnapshot(const char *idstr); extern bool XactHasExportedSnapshots(void);
^ permalink raw reply [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-15 16:43               ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-15 19:15                 ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2017-02-20 12:32                   ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
@ 2017-02-20 16:53                     ` Robert Haas <robertmhaas@gmail.com>
  2017-02-20 17:19                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Robert Haas @ 2017-02-20 16:53 UTC (permalink / raw)
  To: Simon Riggs <simon@2ndquadrant.com>; +Cc: Andres Freund <andres@anarazel.de>; Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Mon, Feb 20, 2017 at 6:02 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
> On 15 February 2017 at 19:15, Andres Freund <andres@anarazel.de> wrote:
>
>> I think I previously
>> mentioned, even just removing the MyPgXact->xmin assignment in
>> SnapshotResetXmin() is measurable performance wise and cache-hit ratio
>> wise.
>
> Currently, we issue SnapshotResetXmin() pointlessly at end of xact, so
> patch attached to remove that call, plus some comments to explain
> that. This reduces the cause.
>
> Also, another patch to reduce the calls to SnapshotResetXmin() using a
> simple heuristic to reduce the effects.

I think skip_SnapshotResetXmin_if_idle_timeout.v1.patch isn't a good
idea, because it could have the surprising result that setting
idle_in_transaction_timeout to a non-zero value makes bloat worse.  I
don't think users will like that.

Regarding reduce_pgxact_access_AtEOXact.v1.patch, it took me a few
minutes to figure out that the comment was referring to
ProcArrayEndTransaction(), so it might be good to be more explicit
about that if we go forward with this.  Have you checked whether this
patch makes any noticeable performance difference?  It's sure
surprising that we go to all of this trouble to clean things up in
AtEOXact_Snapshot() when we've already nuked MyPgXact->xmin from
orbit.  (Instead of changing AtEOXact_Snapshot, should we think about
removing the xid clear logic from ProcArrayEndTransaction and only
doing it here, or would that be wrong-headed?)

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-15 16:43               ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-15 19:15                 ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2017-02-20 12:32                   ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-20 16:53                     ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
@ 2017-02-20 17:19                       ` Simon Riggs <simon@2ndquadrant.com>
  2017-02-20 17:32                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Simon Riggs @ 2017-02-20 17:19 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Andres Freund <andres@anarazel.de>; Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On 20 February 2017 at 16:53, Robert Haas <robertmhaas@gmail.com> wrote:
> On Mon, Feb 20, 2017 at 6:02 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
>> On 15 February 2017 at 19:15, Andres Freund <andres@anarazel.de> wrote:
>>
>>> I think I previously
>>> mentioned, even just removing the MyPgXact->xmin assignment in
>>> SnapshotResetXmin() is measurable performance wise and cache-hit ratio
>>> wise.
>>
>> Currently, we issue SnapshotResetXmin() pointlessly at end of xact, so
>> patch attached to remove that call, plus some comments to explain
>> that. This reduces the cause.
>>
>> Also, another patch to reduce the calls to SnapshotResetXmin() using a
>> simple heuristic to reduce the effects.
>
> I think skip_SnapshotResetXmin_if_idle_timeout.v1.patch isn't a good
> idea, because it could have the surprising result that setting
> idle_in_transaction_timeout to a non-zero value makes bloat worse.  I
> don't think users will like that.
>
> Regarding reduce_pgxact_access_AtEOXact.v1.patch, it took me a few
> minutes to figure out that the comment was referring to
> ProcArrayEndTransaction(), so it might be good to be more explicit
> about that if we go forward with this.

Sure, attached.

> Have you checked whether this
> patch makes any noticeable performance difference?

No, but then we're reducing the number of calls to PgXact directly;
there is no heuristic involved, its just a pure saving.

> It's sure
> surprising that we go to all of this trouble to clean things up in
> AtEOXact_Snapshot() when we've already nuked MyPgXact->xmin from
> orbit.  (Instead of changing AtEOXact_Snapshot, should we think about
> removing the xid clear logic from ProcArrayEndTransaction and only
> doing it here, or would that be wrong-headed?)

If anything, I'd move the call to PgXact->xmin = InvalidTransactionId
into a function inside procarray.c, so we only touch snapshots in
snapmgr.c and all procarray stuff is isolated. (Not done here, yet).

-- 
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

reduce_pgxact_access_AtEOXact.v2.patch (application/octet-stream, 3.5K) download diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 82f9a3c..720b60a 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -2135,7 +2135,7 @@ CommitTransaction(void) AtEOXact_ComboCid(); AtEOXact_HashTables(true); AtEOXact_PgStat(true); - AtEOXact_Snapshot(true); + AtEOXact_Snapshot(true, false); AtCommit_ApplyLauncher(); pgstat_report_xact_timestamp(0); @@ -2407,7 +2407,7 @@ PrepareTransaction(void) AtEOXact_ComboCid(); AtEOXact_HashTables(true); /* don't call AtEOXact_PgStat here; we fixed pgstat state above */ - AtEOXact_Snapshot(true); + AtEOXact_Snapshot(true, true); pgstat_report_xact_timestamp(0); CurrentResourceOwner = NULL; @@ -2638,7 +2638,7 @@ CleanupTransaction(void) * do abort cleanup processing */ AtCleanup_Portals(); /* now safe to release portal memory */ - AtEOXact_Snapshot(false); /* and release the transaction's snapshots */ + AtEOXact_Snapshot(false, false); /* and release the transaction's snapshots */ CurrentResourceOwner = NULL; /* and resource owner */ if (TopTransactionResourceOwner) diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 92afc32..be4adf7 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -954,7 +954,12 @@ xmin_cmp(const pairingheap_node *a, const pairingheap_node *b, void *arg) * * If there are no more snapshots, we can reset our PGXACT->xmin to InvalidXid. * Note we can do this without locking because we assume that storing an Xid - * is atomic. + * is atomic. We do this because it will allow multi-statement transactions to + * reset their xmin and prevent us from holding back removal of dead rows; + * this has little purpose when we are dealing with very fast statements in + * read committed mode since the xmin will advance quickly anyway. It has no + * use at all when we are running single statement transactions since the xmin + * is reset as part of end of transaction anyway. * * Even if there are some remaining snapshots, we may be able to advance our * PGXACT->xmin to some degree. This typically happens when a portal is @@ -1051,7 +1056,7 @@ AtSubAbort_Snapshot(int level) * Snapshot manager's cleanup function for end of transaction */ void -AtEOXact_Snapshot(bool isCommit) +AtEOXact_Snapshot(bool isCommit, bool isPrepare) { /* * In transaction-snapshot mode we must release our privately-managed @@ -1136,7 +1141,17 @@ AtEOXact_Snapshot(bool isCommit) FirstSnapshotSet = false; - SnapshotResetXmin(); + /* + * During normal commit and abort processing, we call + * ProcArrayEndTransaction() or ProcArrayClearTransaction() to + * reset the PgXact->xmin. That call happens prior to the call to + * AtEOXact_Snapshot(), so we need not touch xmin here at all, + * accept when we are preparing a transaction. + */ + if (isPrepare) + SnapshotResetXmin(); + + Assert(MyPgXact->xmin == 0); } diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h index 2618cc4..2ad1e0b 100644 --- a/src/include/utils/snapmgr.h +++ b/src/include/utils/snapmgr.h @@ -85,7 +85,7 @@ extern void UnregisterSnapshotFromOwner(Snapshot snapshot, ResourceOwner owner); extern void AtSubCommit_Snapshot(int level); extern void AtSubAbort_Snapshot(int level); -extern void AtEOXact_Snapshot(bool isCommit); +extern void AtEOXact_Snapshot(bool isCommit, bool isPrepare); extern void ImportSnapshot(const char *idstr); extern bool XactHasExportedSnapshots(void);
^ permalink raw reply [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-15 16:43               ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-15 19:15                 ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2017-02-20 12:32                   ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-20 16:53                     ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-20 17:19                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
@ 2017-02-20 17:32                         ` Robert Haas <robertmhaas@gmail.com>
  2017-02-20 17:56                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Robert Haas @ 2017-02-20 17:32 UTC (permalink / raw)
  To: Simon Riggs <simon@2ndquadrant.com>; +Cc: Andres Freund <andres@anarazel.de>; Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Mon, Feb 20, 2017 at 10:49 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
>> Regarding reduce_pgxact_access_AtEOXact.v1.patch, it took me a few
>> minutes to figure out that the comment was referring to
>> ProcArrayEndTransaction(), so it might be good to be more explicit
>> about that if we go forward with this.
>
> Sure, attached.

Looks better, thanks.

>> Have you checked whether this
>> patch makes any noticeable performance difference?
>
> No, but then we're reducing the number of calls to PgXact directly;
> there is no heuristic involved, its just a pure saving.

Well, it's adding a branch where there wasn't one.  Maybe that costs
essentially nothing and the saved write to shared memory saves
something noticeable, but for all I know it's the reverse.  If I had
to guess, it would be that neither the costs nor the savings from this
are in the slightest way noticeable on a macrobenchmark, and therefore
there's not much point in changing it, but that could be 100% wrong.

>> It's sure
>> surprising that we go to all of this trouble to clean things up in
>> AtEOXact_Snapshot() when we've already nuked MyPgXact->xmin from
>> orbit.  (Instead of changing AtEOXact_Snapshot, should we think about
>> removing the xid clear logic from ProcArrayEndTransaction and only
>> doing it here, or would that be wrong-headed?)
>
> If anything, I'd move the call to PgXact->xmin = InvalidTransactionId
> into a function inside procarray.c, so we only touch snapshots in
> snapmgr.c and all procarray stuff is isolated. (Not done here, yet).

I'm not convinced that really buys us anything except more
function-call overhead.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:07             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-15 16:43               ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-15 19:15                 ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2017-02-20 12:32                   ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-20 16:53                     ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-20 17:19                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-20 17:32                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
@ 2017-02-20 17:56                           ` Simon Riggs <simon@2ndquadrant.com>
  0 siblings, 0 replies; 84+ messages in thread

From: Simon Riggs @ 2017-02-20 17:56 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Andres Freund <andres@anarazel.de>; Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On 20 February 2017 at 17:32, Robert Haas <robertmhaas@gmail.com> wrote:

>>> Have you checked whether this
>>> patch makes any noticeable performance difference?
>>
>> No, but then we're reducing the number of calls to PgXact directly;
>> there is no heuristic involved, its just a pure saving.
>
> Well, it's adding a branch where there wasn't one.

A branch that is avoided in almost all cases, so easy to predict.

> Maybe that costs
> essentially nothing and the saved write to shared memory saves
> something noticeable, but for all I know it's the reverse.  If I had
> to guess, it would be that neither the costs nor the savings from this
> are in the slightest way noticeable on a macrobenchmark, and therefore
> there's not much point in changing it, but that could be 100% wrong.

Given Andres' earlier measurements, it seems worth testing to me.



Hopefully someone can recheck. Thanks in advance.

-- 
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-02-13 16:13             ` Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  1 sibling, 1 reply; 84+ messages in thread

From: Bernd Helmle @ 2017-02-13 16:13 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Am Montag, den 13.02.2017, 16:55 +0300 schrieb Alexander Korotkov:
> 
> Thank you for testing.
> 
> Yes, influence seems to be low.  But nevertheless it's important to
> insure
> that there is no regression here.
> Despite pg_prewarm'ing and running tests 300s, there is still
> significant
> variation.
> For instance, with clients count = 80:
>  * pgxact-result-2.txt – 474704
>  * pgxact-results.txt – 574844

> Could some background processes influence the tests?  Or could it be
> another virtual machine?
> Also, I wonder why I can't see this variation on the graphs.
> Another issue with graphs is that we can't see details of read and
> write

Whoops, good catch. I've mistakenly copied the wrong y-axis for these
results in the gnuplot script, shame on me. New plots attached.

You're right, the 2nd run with the pgxact alignment patch is notable.
I've realized that there was a pgbouncer instance running from a
previous test, but not sure if that could explain the difference.

> TPS variation on the same scale, because write TPS values are too
> low.  I
> think you should draw write benchmark on the separate graph.
> 

The Linux LPAR is the only one used atm. We got some more time for
Linux now and i'm going to prepare Tomas' script to run. Not sure i can
get to it today, though.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

bench.png (image/png, 5.6K) download view image
bench-writes.png (image/png, 5.0K) download view image
^ permalink raw reply [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
@ 2017-02-13 17:02               ` Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  0 siblings, 1 reply; 84+ messages in thread

From: Ashutosh Sharma @ 2017-02-13 17:02 UTC (permalink / raw)
  To: Bernd Helmle <mailings@oopsware.de>; +Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Hi All,

I too have performed benchmarking of this patch on a large machine
(with 128 CPU(s), 520GB RAM, intel x86-64 architecture) and would like
to share my observations for the same (Please note that, as I had to
reverify readings on few client counts, it did take some time for me
to share these test-results.)

Case1: Data fits in shared buffer, Read Only workload:
-------------------------------------------------------------------------------
For data fits in shared buffer, I have taken readings at 300 SF. The
result sheet 'results-readonly-300-1000-SF' containing the median of 3
runs is attached with this mail. In this case, I could see very good
performance improvement with the patch basically at high client counts
(156 - 256).

Case2: Data doesn't fit in shared buffer, Read Only workload:
--------------------------------------------------------------------------------------
For data doesn't fit in shared buffer, I have taken readings at 1000
SF. The result sheet 'results-readonly-300-1000-SF' is attached with
this mail. In this case, the performance improvement is not as in
Case1, Infact it just varies in the range of 2-7%. but the good thing
is that there is no regression.

Case3: Data fits in shared buffer, Read-write workload:
-----------------------------------------------------------------------------
In this case, I could see that the tps on head and patch are very
close to each other with a small variation of (+-)3-4% which i assume
is a run-to-run variation. PFA result sheet
'results-readwrite-300-1000-SF' containing the test-results.

Case4: Data doesn't fit in shared buffer, Read-write workload:
----------------------------------------------------------------------------------------
In this case as well, tps on head and patch are very close to each
other with small variation of 1-2% which again is a run-to-run
variation. PFA result sheet 'results-readwrite-300-1000-SF' containing
the test-results.

Please note that details on the non-default guc params and pgbench is
all provided in the result sheets attached with this mail. Also, I
have not used pg_prewarm in my test script. Thank you.

On Mon, Feb 13, 2017 at 9:43 PM, Bernd Helmle <mailings@oopsware.de> wrote:
> Am Montag, den 13.02.2017, 16:55 +0300 schrieb Alexander Korotkov:
>>
>> Thank you for testing.
>>
>> Yes, influence seems to be low.  But nevertheless it's important to
>> insure
>> that there is no regression here.
>> Despite pg_prewarm'ing and running tests 300s, there is still
>> significant
>> variation.
>> For instance, with clients count = 80:
>>  * pgxact-result-2.txt – 474704
>>  * pgxact-results.txt – 574844
>
>> Could some background processes influence the tests?  Or could it be
>> another virtual machine?
>> Also, I wonder why I can't see this variation on the graphs.
>> Another issue with graphs is that we can't see details of read and
>> write
>
> Whoops, good catch. I've mistakenly copied the wrong y-axis for these
> results in the gnuplot script, shame on me. New plots attached.
>
> You're right, the 2nd run with the pgxact alignment patch is notable.
> I've realized that there was a pgbouncer instance running from a
> previous test, but not sure if that could explain the difference.
>
>> TPS variation on the same scale, because write TPS values are too
>> low.  I
>> think you should draw write benchmark on the separate graph.
>>
>
> The Linux LPAR is the only one used atm. We got some more time for
> Linux now and i'm going to prepare Tomas' script to run. Not sure i can
> get to it today, though.
>
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

  results-readonly-300-1000-SF.xlsx (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, 7.3K) download

  results-readwrite-300-1000-SF.xlsx (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, 10.9K) download

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
@ 2017-02-15 08:49                 ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  0 siblings, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2017-02-15 08:49 UTC (permalink / raw)
  To: Ashutosh Sharma <ashu.coek88@gmail.com>; +Cc: Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Hi!

On Mon, Feb 13, 2017 at 8:02 PM, Ashutosh Sharma <ashu.coek88@gmail.com>
wrote:

> I too have performed benchmarking of this patch on a large machine
> (with 128 CPU(s), 520GB RAM, intel x86-64 architecture) and would like
> to share my observations for the same (Please note that, as I had to
> reverify readings on few client counts, it did take some time for me
> to share these test-results.)
>

Great! Thank you very much for testing.

Case3: Data fits in shared buffer, Read-write workload:
> ------------------------------------------------------------
> -----------------
> In this case, I could see that the tps on head and patch are very
> close to each other with a small variation of (+-)3-4% which i assume
> is a run-to-run variation. PFA result sheet
> 'results-readwrite-300-1000-SF' containing the test-results.
>

I wouldn't say it's just a variation.  It looks like relatively small but
noticeable regression in the patch.
According to Andres comment [1] I made a version of patch
(pgxact-align-3.patch) which align PGXACT to 16 bytes.
That excludes situation when single PGXACT is spread over 2 cache lines.
Results of read-only tests are attached.  We can see that 16-byte alignment
gives speedup in read-only tests, but it's a bit less than speedup of cache
line alignment version.
Read-write tests are now running.  Hopefully 16-byte alignment version of
patch wouldn't cause regression in read-write benchmark.

1.
https://www.postgresql.org/message-id/20160822021747.u5bqx2xwwjzac5u5@alap3.anarazel.de

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

pgxact-align-3.patch (application/octet-stream, 2.6K) download diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c new file mode 100644 index 8f467be..1a05666 *** a/src/backend/storage/lmgr/proc.c --- b/src/backend/storage/lmgr/proc.c *************** InitProcGlobal(void) *** 168,173 **** --- 168,177 ---- bool found; uint32 TotalProcs = MaxBackends + NUM_AUXILIARY_PROCS + max_prepared_xacts; + /* PGXACT should be aligned to the power of 2 */ + StaticAssertExpr((sizeof(PGXACT) & (sizeof(PGXACT) - 1)) == 0, + "PGXACT is not properly aligned"); + /* Create the ProcGlobal shared structure */ ProcGlobal = (PROC_HDR *) ShmemInitStruct("Proc Header", sizeof(PROC_HDR), &found); diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h new file mode 100644 index 5f38fa6..a7e0ea3 *** a/src/include/storage/proc.h --- b/src/include/storage/proc.h *************** extern PGDLLIMPORT struct PGXACT *MyPgXa *** 189,199 **** /* * Prior to PostgreSQL 9.2, the fields below were stored as part of the * PGPROC. However, benchmarking revealed that packing these particular ! * members into a separate array as tightly as possible sped up GetSnapshotData ! * considerably on systems with many CPU cores, by reducing the number of ! * cache lines needing to be fetched. Thus, think very carefully before adding ! * anything else here. */ typedef struct PGXACT { TransactionId xid; /* id of top-level transaction currently being --- 189,208 ---- /* * Prior to PostgreSQL 9.2, the fields below were stored as part of the * PGPROC. However, benchmarking revealed that packing these particular ! * members into a separate array sped up GetSnapshotData considerably on ! * systems with many CPU cores, by reducing the number of cache lines needing ! * to be fetched. Also, this fields are subject of intensive writes even on ! * read-only workloads. Thereby, it's desirable that writes of these fields ! * invalidate as less cache lines as possible. From that point of view, we ! * should prevent PGXACT from being on the boundary of cache lines. In order ! * to achieve that we align PGXACT to the nearest power of 2. That gives ! * considerable speedup on systems with many CPU cores. */ + + /* Calculation of padding for PGXACT. Update this after changing of PGXACT. */ + #define PGXACTPadSize (16 - 2 * sizeof(TransactionId) \ + - 2 * sizeof(uint8) - 2 * sizeof(bool)) + typedef struct PGXACT { TransactionId xid; /* id of top-level transaction currently being *************** typedef struct PGXACT *** 211,216 **** --- 220,227 ---- * previously called InCommit */ uint8 nxids; + + char pad[PGXACTPadSize]; } PGXACT; /*
scalability_pgxact_align-3.png (image/png, 45.0K) download view image
^ permalink raw reply [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-02-15 14:52                   ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2017-02-15 14:52 UTC (permalink / raw)
  To: Ashutosh Sharma <ashu.coek88@gmail.com>; +Cc: Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Wed, Feb 15, 2017 at 11:49 AM, Alexander Korotkov <
a.korotkov@postgrespro.ru> wrote:

> On Mon, Feb 13, 2017 at 8:02 PM, Ashutosh Sharma <ashu.coek88@gmail.com>
> wrote:
>
>> I too have performed benchmarking of this patch on a large machine
>> (with 128 CPU(s), 520GB RAM, intel x86-64 architecture) and would like
>> to share my observations for the same (Please note that, as I had to
>> reverify readings on few client counts, it did take some time for me
>> to share these test-results.)
>>
>
> Great! Thank you very much for testing.
>
> Case3: Data fits in shared buffer, Read-write workload:
>> ------------------------------------------------------------
>> -----------------
>> In this case, I could see that the tps on head and patch are very
>> close to each other with a small variation of (+-)3-4% which i assume
>> is a run-to-run variation. PFA result sheet
>> 'results-readwrite-300-1000-SF' containing the test-results.
>>
>
> I wouldn't say it's just a variation.  It looks like relatively small but
> noticeable regression in the patch.
> According to Andres comment [1] I made a version of patch
> (pgxact-align-3.patch) which align PGXACT to 16 bytes.
> That excludes situation when single PGXACT is spread over 2 cache lines.
> Results of read-only tests are attached.  We can see that 16-byte
> alignment gives speedup in read-only tests, but it's a bit less than
> speedup of cache line alignment version.
> Read-write tests are now running.  Hopefully 16-byte alignment version of
> patch wouldn't cause regression in read-write benchmark.
>
> 1. https://www.postgresql.org/message-id/20160822021747.u5bq
> x2xwwjzac5u5@alap3.anarazel.de
>

RW-benchmark on 72-cores machine is completed.

+-----------+--------+--------+--------+--------+--------+--
------+--------+--------+--------+
|           |          master          |      pgxact-align-2      |
 pgxact-align-3      |
|   clients |      1 |      2 |      3 |      1 |      2 |      3 |      1
|      2 |      3 |
|-----------+--------+--------+--------+--------+--------+--
------+--------+--------+--------|
|         1 |   4696 |   4773 |   4777 |   4449 |   4766 |   4731 |   4658
|   4670 |   4807 |
|         2 |   9127 |   9154 |   9300 |   9224 |   8801 |   9055 |   9278
|   9245 |   8902 |
|         4 |  17377 |  17779 |  17740 |  17936 |  17560 |  17900 |  17806
|  17782 |  17934 |
|         8 |  34348 |  34233 |  34656 |  34204 |  33617 |  34226 |  34446
|  34105 |  34554 |
|        16 |  64350 |  64530 |  64574 |  63474 |  62852 |  63622 |  63942
|  62268 |  63396 |
|        20 |  76648 |  76515 |  75026 |  75123 |  74624 |  76461 |  77756
|  77245 |  76263 |
|        40 |  98566 | 100429 | 103499 | 103118 | 100186 |  99550 | 101489
| 102363 | 102015 |
|        60 | 106871 | 107842 | 107724 | 107168 | 107645 | 104791 | 109388
| 109367 | 106146 |
|        80 | 109461 | 108467 | 108913 | 104780 | 109742 | 106929 | 111254
| 107688 | 109581 |
|       100 |  98772 |  98641 |  94742 | 100390 | 102977 |  99691 |  99296
|  95699 | 103675 |
|       120 |  92740 |  94659 |  93876 |  91856 |  90732 |  91560 |  92334
|  88746 |  94663 |
|       140 |  88400 |  89448 |  89600 |  87173 |  90152 |  88190 |  88174
|  92784 |  91788 |
|       150 |  87292 |  92834 |  89714 |  86626 |  93090 |  88887 |  89407
|  88234 |  92760 |
|       160 |  88704 |  86890 |  87668 |  91025 |  89734 |  86875 |  88398
|  87846 |  87659 |
|       180 |  85451 |  84611 |  81913 |  86939 |  85888 |  86000 |  87287
|  85644 |  82915 |
|       200 |  73796 |  81149 |  81674 |  76179 |  73104 |  79381 |  82456
|  79920 |  76239 |
|       220 |  68113 |  69765 |  67871 |  67611 |  74125 |  66436 |  64810
|  72282 |  71387 |
|       240 |  63528 |  61462 |  65662 |  61711 |  61697 |  63032 |  65435
|  61804 |  59918 |
+-----------+--------+--------+--------+--------+--------+--
------+--------+--------+--------+

Difference between master, pgxact-align-2 and pgxact-align-3 doesn't exceed
per run variation.
Thus, at this test we can't confirm  neither regression in pgxact-align-2,
neither improvement in pgxact-align-3.
Ashutosh, could you please repeat your benchmarks with pgxact-align-3?

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

scalability_pgxact_align-3-rw.png (image/png, 51.1K) download view image
^ permalink raw reply [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-02-15 17:49                     ` Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  0 siblings, 1 reply; 84+ messages in thread

From: Alvaro Herrera @ 2017-02-15 17:49 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: Ashutosh Sharma <ashu.coek88@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Alexander Korotkov wrote:

> Difference between master, pgxact-align-2 and pgxact-align-3 doesn't exceed
> per run variation.

FWIW this would be more visible if you added error bars to each data
point.  Should be simple enough in gnuplot ...

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2017-02-16 10:07                       ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2017-02-16 10:07 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Ashutosh Sharma <ashu.coek88@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Wed, Feb 15, 2017 at 8:49 PM, Alvaro Herrera <alvherre@2ndquadrant.com>
wrote:

> Alexander Korotkov wrote:
>
> > Difference between master, pgxact-align-2 and pgxact-align-3 doesn't
> exceed
> > per run variation.
>
> FWIW this would be more visible if you added error bars to each data
> point.  Should be simple enough in gnuplot ...


Good point.
Please find graph of mean and errors in attachment.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

scalability_pgxact_align-3-rw-errors.png (image/png, 121.1K) download view image
^ permalink raw reply [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-02-16 13:58                         ` Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  0 siblings, 1 reply; 84+ messages in thread

From: Robert Haas @ 2017-02-16 13:58 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Ashutosh Sharma <ashu.coek88@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Thu, Feb 16, 2017 at 5:07 AM, Alexander Korotkov
<a.korotkov@postgrespro.ru> wrote:
> On Wed, Feb 15, 2017 at 8:49 PM, Alvaro Herrera <alvherre@2ndquadrant.com>
> wrote:
>> Alexander Korotkov wrote:
>>
>> > Difference between master, pgxact-align-2 and pgxact-align-3 doesn't
>> > exceed
>> > per run variation.
>>
>> FWIW this would be more visible if you added error bars to each data
>> point.  Should be simple enough in gnuplot ...
>
> Good point.
> Please find graph of mean and errors in attachment.

So ... no difference?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
@ 2017-02-17 09:23                           ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-17 09:44                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 2 replies; 84+ messages in thread

From: Alexander Korotkov @ 2017-02-17 09:23 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Ashutosh Sharma <ashu.coek88@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Thu, Feb 16, 2017 at 4:58 PM, Robert Haas <robertmhaas@gmail.com> wrote:

> On Thu, Feb 16, 2017 at 5:07 AM, Alexander Korotkov
> <a.korotkov@postgrespro.ru> wrote:
> > On Wed, Feb 15, 2017 at 8:49 PM, Alvaro Herrera <
> alvherre@2ndquadrant.com>
> > wrote:
> >> Alexander Korotkov wrote:
> >>
> >> > Difference between master, pgxact-align-2 and pgxact-align-3 doesn't
> >> > exceed
> >> > per run variation.
> >>
> >> FWIW this would be more visible if you added error bars to each data
> >> point.  Should be simple enough in gnuplot ...
> >
> > Good point.
> > Please find graph of mean and errors in attachment.
>
> So ... no difference?


Yeah, nothing surprising.  It's just another graph based on the same data.
I wonder how pgxact-align-3 would work on machine of Ashutosh Sharma,
because I observed regression there in write-heavy benchmark of
pgxact-align-2.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-02-17 09:44                             ` Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-17 09:50                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-20 10:20                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  1 sibling, 2 replies; 84+ messages in thread

From: Ashutosh Sharma @ 2017-02-17 09:44 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: Robert Haas <robertmhaas@gmail.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Hi,

>> On Thu, Feb 16, 2017 at 5:07 AM, Alexander Korotkov
>> <a.korotkov@postgrespro.ru> wrote:
>> > On Wed, Feb 15, 2017 at 8:49 PM, Alvaro Herrera
>> > <alvherre@2ndquadrant.com>
>> > wrote:
>> >> Alexander Korotkov wrote:
>> >>
>> >> > Difference between master, pgxact-align-2 and pgxact-align-3 doesn't
>> >> > exceed
>> >> > per run variation.
>> >>
>> >> FWIW this would be more visible if you added error bars to each data
>> >> point.  Should be simple enough in gnuplot ...
>> >
>> > Good point.
>> > Please find graph of mean and errors in attachment.
>>
>> So ... no difference?
>
>
> Yeah, nothing surprising.  It's just another graph based on the same data.
> I wonder how pgxact-align-3 would work on machine of Ashutosh Sharma,
> because I observed regression there in write-heavy benchmark of
> pgxact-align-2.

I am yet to benchmark pgxact-align-3 patch on a read-write workload. I
could not do it as our benchmarking machine was already reserved for
some other test work. But, I am planning to do it on this weekend.
Will try to post my results by Monday evening. Thank you and sorry for
the delayed response.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-17 09:44                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
@ 2017-02-17 09:50                               ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  1 sibling, 0 replies; 84+ messages in thread

From: Alexander Korotkov @ 2017-02-17 09:50 UTC (permalink / raw)
  To: Ashutosh Sharma <ashu.coek88@gmail.com>; +Cc: Robert Haas <robertmhaas@gmail.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Fri, Feb 17, 2017 at 12:44 PM, Ashutosh Sharma <ashu.coek88@gmail.com>
wrote:

> >> On Thu, Feb 16, 2017 at 5:07 AM, Alexander Korotkov
> >> <a.korotkov@postgrespro.ru> wrote:
> >> > On Wed, Feb 15, 2017 at 8:49 PM, Alvaro Herrera
> >> > <alvherre@2ndquadrant.com>
> >> > wrote:
> >> >> Alexander Korotkov wrote:
> >> >>
> >> >> > Difference between master, pgxact-align-2 and pgxact-align-3
> doesn't
> >> >> > exceed
> >> >> > per run variation.
> >> >>
> >> >> FWIW this would be more visible if you added error bars to each data
> >> >> point.  Should be simple enough in gnuplot ...
> >> >
> >> > Good point.
> >> > Please find graph of mean and errors in attachment.
> >>
> >> So ... no difference?
> >
> >
> > Yeah, nothing surprising.  It's just another graph based on the same
> data.
> > I wonder how pgxact-align-3 would work on machine of Ashutosh Sharma,
> > because I observed regression there in write-heavy benchmark of
> > pgxact-align-2.
>
> I am yet to benchmark pgxact-align-3 patch on a read-write workload. I
> could not do it as our benchmarking machine was already reserved for
> some other test work. But, I am planning to do it on this weekend.
> Will try to post my results by Monday evening. Thank you and sorry for
> the delayed response.
>

Cool, thank you very much!

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-17 09:44                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
@ 2017-02-20 10:20                               ` Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-21 10:51                                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  1 sibling, 1 reply; 84+ messages in thread

From: Ashutosh Sharma @ 2017-02-20 10:20 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: Robert Haas <robertmhaas@gmail.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Hi,

>> On Thu, Feb 16, 2017 at 5:07 AM, Alexander Korotkov
> >> <a.korotkov@postgrespro.ru> wrote:
> >> > On Wed, Feb 15, 2017 at 8:49 PM, Alvaro Herrera
> >> > <alvherre@2ndquadrant.com>
> >> > wrote:
> >> >> Alexander Korotkov wrote:
> >> >>
> >> >> > Difference between master, pgxact-align-2 and pgxact-align-3
> doesn't
> >> >> > exceed
> >> >> > per run variation.
> >> >>
> >> >> FWIW this would be more visible if you added error bars to each data
> >> >> point.  Should be simple enough in gnuplot ...
> >> >
> >> > Good point.
> >> > Please find graph of mean and errors in attachment.
> >>
> >> So ... no difference?
> >
> >
> > Yeah, nothing surprising.  It's just another graph based on the same
> data.
> > I wonder how pgxact-align-3 would work on machine of Ashutosh Sharma,
> > because I observed regression there in write-heavy benchmark of
> > pgxact-align-2.
>
> I am yet to benchmark pgxact-align-3 patch on a read-write workload. I
> could not do it as our benchmarking machine was already reserved for
> some other test work. But, I am planning to do it on this weekend.
> Will try to post my results by Monday evening. Thank you and sorry for
> the delayed response.
>

Following are the pgbench results for read-write workload, I got with
pgxact-align-3 patch. The results are for 300 scale factor with 8GB of
shared buffer i.e. when data fits into the shared buffer. For 1000 scale
factor with 8GB shared buffer the test is still running, once it is
completed I will share the results for that as well.

*pgbench settings:*
pgbench -i -s 300 postgres
pgbench -M prepared -c $thread -j $thread -T $time_for_reading  postgres

where, time_for_reading = 30mins

*non default GUC param:*
shared_buffers=8GB
max_connections=300

pg_xlog is located in SSD.

*Machine details:*
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                128
On-line CPU(s) list:   0-127
Thread(s) per core:    2
Core(s) per socket:    8
Socket(s):             8
NUMA node(s):          8
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 47
Model name:            Intel(R) Xeon(R) CPU E7- 8830  @ 2.13GHz


CLIENT COUNT TPS (HEAD) TPS (PATCH) % IMPROVEMENT
4 4283 4220 -1.47093159
8 7291 7261 -0.4114661912
16 11909 12149 2.015282559
32 20789 20745 -0.211650392
64 28412 27831 -2.044910601
128 29369 28765 -2.056590282
156 27949 27189 -2.719238613
180 27876 27171 -2.529057254
196 28849 27872 -3.386599189
256 30321 28188 -7.034728406
Also, Excel sheet (results-read-write-300-SF) containing the results for
all the 3 runs is attached.

--
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

  results-read-write-300-SF.xlsx (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, 7.3K) download

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-17 09:44                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-20 10:20                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
@ 2017-02-21 10:51                                 ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-21 11:27                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2017-02-21 10:51 UTC (permalink / raw)
  To: Ashutosh Sharma <ashu.coek88@gmail.com>; +Cc: Robert Haas <robertmhaas@gmail.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Hi, Ashutosh!

On Mon, Feb 20, 2017 at 1:20 PM, Ashutosh Sharma <ashu.coek88@gmail.com>
wrote:

> Following are the pgbench results for read-write workload, I got with
> pgxact-align-3 patch. The results are for 300 scale factor with 8GB of
> shared buffer i.e. when data fits into the shared buffer. For 1000 scale
> factor with 8GB shared buffer the test is still running, once it is
> completed I will share the results for that as well.
>
> *pgbench settings:*
> pgbench -i -s 300 postgres
> pgbench -M prepared -c $thread -j $thread -T $time_for_reading  postgres
>
> where, time_for_reading = 30mins
>
> *non default GUC param:*
> shared_buffers=8GB
> max_connections=300
>
> pg_xlog is located in SSD.
>

Thank you for testing.
It seems that there is still regression.  While padding was reduced from
116 bytes to 4 bytes, it makes me think that probably there is something
wrong in testing methodology.
Are you doing re-initdb and pgbench -i before each run?  I would ask you to
do the both.
Also, if regression would still exist, let's change the order of versions.
Thus, if you run master before patched version, I would ask you to run
patched version before master.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-17 09:44                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-20 10:20                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-21 10:51                                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-02-21 11:27                                   ` Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-21 11:37                                     ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  0 siblings, 1 reply; 84+ messages in thread

From: Ashutosh Sharma @ 2017-02-21 11:27 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: Robert Haas <robertmhaas@gmail.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Tue, Feb 21, 2017 at 4:21 PM, Alexander Korotkov
<a.korotkov@postgrespro.ru> wrote:
>
> Hi, Ashutosh!
> On Mon, Feb 20, 2017 at 1:20 PM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
>>
>> Following are the pgbench results for read-write workload, I got with pgxact-align-3 patch. The results are for 300 scale factor with 8GB of shared buffer i.e. when data fits into the shared buffer. For 1000 scale factor with 8GB shared buffer the test is still running, once it is completed I will share the results for that as well.
>>
>> pgbench settings:
>> pgbench -i -s 300 postgres
>> pgbench -M prepared -c $thread -j $thread -T $time_for_reading  postgres
>>
>> where, time_for_reading = 30mins
>>
>> non default GUC param:
>> shared_buffers=8GB
>> max_connections=300
>>
>> pg_xlog is located in SSD.
>
>
> Thank you for testing.
> It seems that there is still regression.  While padding was reduced from 116 bytes to 4 bytes, it makes me think that probably there is something wrong in testing methodology.
> Are you doing re-initdb and pgbench -i before each run?  I would ask you to do the both.
> Also, if regression would still exist, let's change the order of versions.  Thus, if you run master before patched version, I would ask you to run patched version before master.


Yes, there is still some regression however it has come down by a
small margin. I am not doing initdb for each run instead I am doing,
dropdb-->createdb-->pgbench -i. Is dropping old database and creating
a new one for every run not okay, Do I have to do initdb every time.
Okay, I can change the order of reading and let you know the results.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-17 09:44                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-20 10:20                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-21 10:51                                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-21 11:27                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
@ 2017-02-21 11:37                                     ` Andres Freund <andres@anarazel.de>
  2017-02-21 12:22                                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  0 siblings, 1 reply; 84+ messages in thread

From: Andres Freund @ 2017-02-21 11:37 UTC (permalink / raw)
  To: Ashutosh Sharma <ashu.coek88@gmail.com>; +Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>; Robert Haas <robertmhaas@gmail.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Hi,

On 2017-02-21 16:57:36 +0530, Ashutosh Sharma wrote:
> Yes, there is still some regression however it has come down by a
> small margin. I am not doing initdb for each run instead I am doing,
> dropdb-->createdb-->pgbench -i. Is dropping old database and creating
> a new one for every run not okay, Do I have to do initdb every time.
> Okay, I can change the order of reading and let you know the results.

That does make a difference. Primarily because WAL writes in a new
cluster are a more expensive than in an old one, because of segment
recycling.

- Andres


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-17 09:44                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-20 10:20                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-21 10:51                                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-21 11:27                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-21 11:37                                     ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
@ 2017-02-21 12:22                                       ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-21 13:03                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2017-02-21 12:22 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Ashutosh Sharma <ashu.coek88@gmail.com>; Robert Haas <robertmhaas@gmail.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Tue, Feb 21, 2017 at 2:37 PM, Andres Freund <andres@anarazel.de> wrote:

> On 2017-02-21 16:57:36 +0530, Ashutosh Sharma wrote:
> > Yes, there is still some regression however it has come down by a
> > small margin. I am not doing initdb for each run instead I am doing,
> > dropdb-->createdb-->pgbench -i. Is dropping old database and creating
> > a new one for every run not okay, Do I have to do initdb every time.
> > Okay, I can change the order of reading and let you know the results.
>
> That does make a difference. Primarily because WAL writes in a new
> cluster are a more expensive than in an old one, because of segment
> recycling.
>

+1

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-17 09:44                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-20 10:20                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-21 10:51                                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-21 11:27                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-21 11:37                                     ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2017-02-21 12:22                                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-02-21 13:03                                         ` Ashutosh Sharma <ashu.coek88@gmail.com>
  0 siblings, 0 replies; 84+ messages in thread

From: Ashutosh Sharma @ 2017-02-21 13:03 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: Andres Freund <andres@anarazel.de>; Robert Haas <robertmhaas@gmail.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Tue, Feb 21, 2017 at 5:52 PM, Alexander Korotkov
<a.korotkov@postgrespro.ru> wrote:
> On Tue, Feb 21, 2017 at 2:37 PM, Andres Freund <andres@anarazel.de> wrote:
>>
>> On 2017-02-21 16:57:36 +0530, Ashutosh Sharma wrote:
>> > Yes, there is still some regression however it has come down by a
>> > small margin. I am not doing initdb for each run instead I am doing,
>> > dropdb-->createdb-->pgbench -i. Is dropping old database and creating
>> > a new one for every run not okay, Do I have to do initdb every time.
>> > Okay, I can change the order of reading and let you know the results.
>>
>> That does make a difference. Primarily because WAL writes in a new
>> cluster are a more expensive than in an old one, because of segment
>> recycling.
>
>
> +1

okay, understood. Will take care of it when I start with next round of
testing. Thanks.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-02-22 21:14                             ` Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  1 sibling, 1 reply; 84+ messages in thread

From: Alvaro Herrera @ 2017-02-22 21:14 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: Robert Haas <robertmhaas@gmail.com>; Ashutosh Sharma <ashu.coek88@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

I wonder if this "perf c2c" tool with Linux 4.10 might be useful in
studying this problem.
https://joemario.github.io/blog/2016/09/01/c2c-blog/

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2017-02-24 04:41                               ` Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Ashutosh Sharma @ 2017-02-24 04:41 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Okay. As suggested by Alexander, I have changed the order of reading and
doing initdb for each pgbench run. With these changes, I got following
results at 300 scale factor with 8GB of shared buffer.

*pgbench settings:*
pgbench -i -s 300 postgres
pgbench -M prepared -c $thread -j $thread -T $time_for_reading  postgres

where, time_for_reading = 30mins

*non default GUC param*
shared_buffers=8GB
max_connections=300

pg_xlog is located in SSD.

CLIENT COUNT TPS (HEAD) TPS (PATCH) % IMPROVEMENT
4 2803 2843 1.427042455
8 5315 5225 -1.69332079
32 19755 19669 -0.4353328271
64 28679 27980 -2.437323477
128 28887 28008 -3.042891266
156 27465 26728 -2.683415256
180 27425 26697 -2.654512306
196 28826 27396 -4.960799278
256 29787 28107 -5.640044315
The test machine details are as follows,

*Machine details:*
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                128
On-line CPU(s) list:   0-127
Thread(s) per core:    2
Core(s) per socket:    8
Socket(s):             8
NUMA node(s):          8
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 47
Model name:            Intel(R) Xeon(R) CPU E7- 8830  @ 2.13GHz

Also, Excel sheet (results-readwrite-300-SF) containing the results for all
the 3 runs is attached.

-- 
With Regards,
Ashutosh Sharma
EnterpriseDB:*http://www.enterprisedb.com <http://www.enterprisedb.com/>*


On Thu, Feb 23, 2017 at 2:44 AM, Alvaro Herrera <alvherre@2ndquadrant.com>
wrote:

> I wonder if this "perf c2c" tool with Linux 4.10 might be useful in
> studying this problem.
> https://joemario.github.io/blog/2016/09/01/c2c-blog/
>
> --
> Álvaro Herrera                https://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

  results-readwrite-300-SF.xlsx (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, 7.2K) download

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
@ 2017-02-24 05:11                                 ` Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Simon Riggs @ 2017-02-24 05:11 UTC (permalink / raw)
  To: Ashutosh Sharma <ashu.coek88@gmail.com>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On 24 February 2017 at 04:41, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:

> Okay. As suggested by Alexander, I have changed the order of reading and
> doing initdb for each pgbench run. With these changes, I got following
> results at 300 scale factor with 8GB of shared buffer.
>

Would you be able to test my patch also please?

-- 
Simon Riggs                http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/;
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
@ 2017-02-24 06:52                                   ` Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Ashutosh Sharma @ 2017-02-24 06:52 UTC (permalink / raw)
  To: Simon Riggs <simon@2ndquadrant.com>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Fri, Feb 24, 2017 at 10:41 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
> On 24 February 2017 at 04:41, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
>>
>> Okay. As suggested by Alexander, I have changed the order of reading and
>> doing initdb for each pgbench run. With these changes, I got following
>> results at 300 scale factor with 8GB of shared buffer.
>
>
> Would you be able to test my patch also please?
>

Sure, I can do that and share the results by early next week. Thanks.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
@ 2017-02-28 11:34                                     ` Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Ashutosh Sharma @ 2017-02-28 11:34 UTC (permalink / raw)
  To: Simon Riggs <simon@2ndquadrant.com>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Hi,

On Fri, Feb 24, 2017 at 12:22 PM, Ashutosh Sharma <ashu.coek88@gmail.com>
wrote:

On Fri, Feb 24, 2017 at 10:41 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
> > On 24 February 2017 at 04:41, Ashutosh Sharma <ashu.coek88@gmail.com>
> wrote:
> >>
> >> Okay. As suggested by Alexander, I have changed the order of reading and
> >> doing initdb for each pgbench run. With these changes, I got following
> >> results at 300 scale factor with 8GB of shared buffer.
> >
> >
> > Would you be able to test my patch also please?
> >
>
> Sure, I can do that and share the results by early next week. Thanks.
>

So, Here are the pgbench results I got with '
*reduce_pgxact_access_AtEOXact.v2.patch*' on a read-write workload.

*pgbench settings:*
pgbench -i -s 300 postgres
pgbench -M prepared -c $thread -j $thread -T $time_for_reading  postgres

where, time_for_reading = 30mins

*non default GUC param*
shared_buffers=8GB
max_connections=300

pg_wal is located in SSD.

CLIENT COUNT TPS (HEAD) TPS (PATCH) % IMPROVEMENT
4 2588 2601 0.5023183926
8 5094 5098 0.0785237534
16 10294 10307 0.1262871576
32 19779 19815 0.182011224
64 27908 28346 1.569442454
72 27823 28416 2.131330194
128 28455 28618 0.5728342998
180 26739 26879 0.5235797898
196 27820 27963 0.5140186916
256 28763 28969 0.7161978931

Also, Excel sheet (results-readwrite-300-SF.xlsx) containing the results
for all the 3 runs is attached.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

  results-readwrite-300-SF_EOXACT.xlsx (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, 7.3K) download

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
@ 2017-02-28 18:14                                       ` Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Simon Riggs @ 2017-02-28 18:14 UTC (permalink / raw)
  To: Ashutosh Sharma <ashu.coek88@gmail.com>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On 28 February 2017 at 11:34, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:


> So, Here are the pgbench results I got with '
> *reduce_pgxact_access_AtEOXact.v2.patch*' on a read-write workload.
>

Thanks for performing a test.

I see a low yet noticeable performance gain across the board on that
workload.

That is quite surprising to see a gain on that workload. The main workload
we have been discussing was the full read-only test (-S). For that case the
effect should be much more noticeable based upon Andres' earlier comments.

Would it be possible to re-run the test using only the -S workload? Thanks
very much.


>
> *pgbench settings:*
> pgbench -i -s 300 postgres
> pgbench -M prepared -c $thread -j $thread -T $time_for_reading  postgres
>
> where, time_for_reading = 30mins
>
> *non default GUC param*
> shared_buffers=8GB
> max_connections=300
>
> pg_wal is located in SSD.
>
> CLIENT COUNT TPS (HEAD) TPS (PATCH) % IMPROVEMENT
> 4 2588 2601 0.5023183926 <(502)%20318-3926>
> 8 5094 5098 0.0785237534
> 16 10294 10307 0.1262871576
> 32 19779 19815 0.182011224
> 64 27908 28346 1.569442454
> 72 27823 28416 2.131330194
> 128 28455 28618 0.5728342998
> 180 26739 26879 0.5235797898
> 196 27820 27963 0.5140186916
> 256 28763 28969 0.7161978931
>
> Also, Excel sheet (results-readwrite-300-SF.xlsx) containing the results
> for all the 3 runs is attached.
>



-- 
Simon Riggs                http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/;
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
@ 2017-03-01 04:50                                         ` Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Ashutosh Sharma @ 2017-03-01 04:50 UTC (permalink / raw)
  To: Simon Riggs <simon@2ndquadrant.com>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Tue, Feb 28, 2017 at 11:44 PM, Simon Riggs <simon@2ndquadrant.com> wrote:

> On 28 February 2017 at 11:34, Ashutosh Sharma <ashu.coek88@gmail.com>
> wrote:
>
>
>> So, Here are the pgbench results I got with '
>> *reduce_pgxact_access_AtEOXact.v2.patch*' on a read-write workload.
>>
>
> Thanks for performing a test.
>
> I see a low yet noticeable performance gain across the board on that
> workload.
>
> That is quite surprising to see a gain on that workload. The main workload
> we have been discussing was the full read-only test (-S). For that case the
> effect should be much more noticeable based upon Andres' earlier comments.
>
> Would it be possible to re-run the test using only the -S workload? Thanks
> very much.
>

Okay, I already had the results for read-oly workload but just forgot to
share it along with the results for read-write test. Here are the results
for read-only
test,

CLIENT COUNT TPS (HEAD) TPS (PATCH) % IMPROVEMENT
4 26322 31259 18.75617354
8 63499 69472 9.406447346
16 181155 186534 2.96928045
32 333504 337533 1.208081462
64 350341 353747 0.9721956608
72 366339 373898 2.063389374
128 443381 478562 7.934710779
180 299875 334118 11.41909129
196 269194 275525 2.351835479
256 220027 235995 7.257291151

The pgbench settings and non-default params are,

pgbench -i -s 300 postgres
pgbench -M prepared -c $thread -j $thread -T $time_for_reading -S postgres

where, time_for_reading = 10mins

*non default param:*
shared_buffers=8GB
max_connections=300

--
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com

>
>> *pgbench settings:*
>> pgbench -i -s 300 postgres
>> pgbench -M prepared -c $thread -j $thread -T $time_for_reading  postgres
>>
>> where, time_for_reading = 30mins
>>
>> *non default GUC param*
>> shared_buffers=8GB
>> max_connections=300
>>
>> pg_wal is located in SSD.
>>
>> CLIENT COUNT TPS (HEAD) TPS (PATCH) % IMPROVEMENT
>> 4 2588 2601 0.5023183926 <%28502%29%20318-3926>
>> 8 5094 5098 0.0785237534
>> 16 10294 10307 0.1262871576
>> 32 19779 19815 0.182011224
>> 64 27908 28346 1.569442454
>> 72 27823 28416 2.131330194
>> 128 28455 28618 0.5728342998
>> 180 26739 26879 0.5235797898
>> 196 27820 27963 0.5140186916
>> 256 28763 28969 0.7161978931
>>
>> Also, Excel sheet (results-readwrite-300-SF.xlsx) containing the results
>> for all the 3 runs is attached.
>>
>
>
>
> --
> Simon Riggs                http://www.2ndQuadrant.com/
> <http://www.2ndquadrant.com/;
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
@ 2017-03-01 11:59                                           ` Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Simon Riggs @ 2017-03-01 11:59 UTC (permalink / raw)
  To: Ashutosh Sharma <ashu.coek88@gmail.com>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On 1 March 2017 at 04:50, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:

> On Tue, Feb 28, 2017 at 11:44 PM, Simon Riggs <simon@2ndquadrant.com>
> wrote:
>
>> On 28 February 2017 at 11:34, Ashutosh Sharma <ashu.coek88@gmail.com>
>> wrote:
>>
>>
>>> So, Here are the pgbench results I got with '
>>> *reduce_pgxact_access_AtEOXact.v2.patch*' on a read-write workload.
>>>
>>
>> Thanks for performing a test.
>>
>> I see a low yet noticeable performance gain across the board on that
>> workload.
>>
>> That is quite surprising to see a gain on that workload. The main
>> workload we have been discussing was the full read-only test (-S). For that
>> case the effect should be much more noticeable based upon Andres' earlier
>> comments.
>>
>> Would it be possible to re-run the test using only the -S workload?
>> Thanks very much.
>>
>
> Okay, I already had the results for read-oly workload but just forgot to
> share it along with the results for read-write test. Here are the results
> for read-only
> test,
>

Thanks for conducting those comparisons.

So we have variable and sometimes significant gains, with no regressions.

By the shape of the results this helps in different places to the alignment
patch. Do we have evidence to commit both?

-- 
Simon Riggs                http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/;
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
@ 2017-03-01 15:44                                             ` Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  0 siblings, 1 reply; 84+ messages in thread

From: Ashutosh Sharma @ 2017-03-01 15:44 UTC (permalink / raw)
  To: Simon Riggs <simon@2ndquadrant.com>; +Cc: Alvaro Herrera <alvherre@2ndquadrant.com>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Wed, Mar 1, 2017 at 5:29 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
>
> On 1 March 2017 at 04:50, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
>>
>> On Tue, Feb 28, 2017 at 11:44 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
>>>
>>> On 28 February 2017 at 11:34, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
>>>
>>>>
>>>> So, Here are the pgbench results I got with 'reduce_pgxact_access_AtEOXact.v2.patch' on a read-write workload.
>>>
>>>
>>> Thanks for performing a test.
>>>
>>> I see a low yet noticeable performance gain across the board on that workload.
>>>
>>> That is quite surprising to see a gain on that workload. The main workload we have been discussing was the full read-only test (-S). For that case the effect should be much more noticeable based upon Andres' earlier comments.
>>>
>>> Would it be possible to re-run the test using only the -S workload? Thanks very much.
>>
>>
>> Okay, I already had the results for read-oly workload but just forgot to share it along with the results for read-write test. Here are the results for read-only
>> test,
>
>
> Thanks for conducting those comparisons.
>
> So we have variable and sometimes significant gains, with no regressions.
>
> By the shape of the results this helps in different places to the alignment patch. Do we have evidence to commit both?

Well, We have seen some regression in read-write test with pgxact
alignment patch - [1]. I may need to run the test with both the
patches to see the combined effect on performance.

[1] - https://www.postgresql.org/message-id/CAE9k0Pk%2BrCuNY%2B7O5XwVXHPuki9t8%3DM7jr4kevxw-hdkpFhS2A%40ma...


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
@ 2017-03-10 09:30                                               ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  0 siblings, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2017-03-10 09:30 UTC (permalink / raw)
  To: Ashutosh Sharma <ashu.coek88@gmail.com>; +Cc: Simon Riggs <simon@2ndquadrant.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Wed, Mar 1, 2017 at 6:44 PM, Ashutosh Sharma <ashu.coek88@gmail.com>
wrote:

> On Wed, Mar 1, 2017 at 5:29 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
> >
> > On 1 March 2017 at 04:50, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
> >>
> >> On Tue, Feb 28, 2017 at 11:44 PM, Simon Riggs <simon@2ndquadrant.com>
> wrote:
> >>>
> >>> On 28 February 2017 at 11:34, Ashutosh Sharma <ashu.coek88@gmail.com>
> wrote:
> >>>
> >>>>
> >>>> So, Here are the pgbench results I got with 'reduce_pgxact_access_AtEOXact.v2.patch'
> on a read-write workload.
> >>>
> >>>
> >>> Thanks for performing a test.
> >>>
> >>> I see a low yet noticeable performance gain across the board on that
> workload.
> >>>
> >>> That is quite surprising to see a gain on that workload. The main
> workload we have been discussing was the full read-only test (-S). For that
> case the effect should be much more noticeable based upon Andres' earlier
> comments.
> >>>
> >>> Would it be possible to re-run the test using only the -S workload?
> Thanks very much.
> >>
> >>
> >> Okay, I already had the results for read-oly workload but just forgot
> to share it along with the results for read-write test. Here are the
> results for read-only
> >> test,
> >
> >
> > Thanks for conducting those comparisons.
> >
> > So we have variable and sometimes significant gains, with no regressions.
> >
> > By the shape of the results this helps in different places to the
> alignment patch. Do we have evidence to commit both?
>
> Well, We have seen some regression in read-write test with pgxact
> alignment patch - [1]. I may need to run the test with both the
> patches to see the combined effect on performance.
>
> [1] - https://www.postgresql.org/message-id/CAE9k0Pk%2BrCuNY%
> 2B7O5XwVXHPuki9t8%3DM7jr4kevxw-hdkpFhS2A%40mail.gmail.com
>

I agree.  Probably Simon's patch for reducing pgxact access could negate
regression in pgxact alignment patch.
Ashutosh, could please you run read-write and read-only tests when both
these patches applied?

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-03-10 13:01                                                 ` Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 13:08                                                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  0 siblings, 1 reply; 84+ messages in thread

From: Ashutosh Sharma @ 2017-03-10 13:01 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: Simon Riggs <simon@2ndquadrant.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Hi,

>
> I agree.  Probably Simon's patch for reducing pgxact access could negate
> regression in pgxact alignment patch.
> Ashutosh, could please you run read-write and read-only tests when both
> these patches applied?

I already had the results with both the patches applied. But, as I was not
quite
able to understand on how Simon's patch for reducing pgxact access could
negate the regression on read-write workload that we saw with pgxact-align-3
patch earlier, I was slightly hesitant to share the results. Anyways, here
are
the results with combined patches on readonly and readwrite workload:

1) Results for read-only workload:
========================
pgbench -i -s 300 postgres
pgbench -M prepared -c $thread -j $thread -T $time_for_reading -S postgres

where, time_for_reading = 10mins
*non default param:*
shared_buffers=8GB
max_connections=300

CLIENT COUNT TPS (HEAD) TPS (PATCH) % IMPROVEMENT
4 36333 36835 1.381664052
8 70179 72496 3.301557446
16 169303 175743 3.803831001
32 328837 341093 3.727074508
64 363352 399847 10.04397939
72 372011 413437 11.13569222
128 443979 578355 30.26629638
180 321420 552373 71.85396055
196 276780 558896 101.927885
256 234563 568951 142.5578629

2) Results for read-write workload:
=========================
pgbench -i -s 300 postgres
pgbench -M prepared -c $thread -j $thread -T $time_for_reading  postgres

where, time_for_reading = 30mins

non default param:
shared_buffers=8GB
max_connections=300


CLIENT COUNT TPS (HEAD) TPS (PATCH) % IMPROVEMENT
4 2683 2690 0.2609019754
8 5321 5332 0.2067280586
16 10348 10387 0.3768844221
32 19446 19754 1.58387329
64 28178 28198 0.0709773582
72 28296 28639 1.212185468
128 28577 28600 0.0804843056
180 26665 27525 3.225201575
196 27628 28511 3.19603301
256 28467 28529 0.2177960445

HEAD is basically referring to the following git commit in master branch,

commit 5dbdb2f799232cb1b6df7d7a85d59ade3234d30c
Author: Robert Haas <rhaas@postgresql.org>
Date:   Fri Feb 24 12:21:46 2017 +0530

    Make tablesample work with partitioned tables.

    This was an oversight in the original partitioning commit.

    Amit Langote, reviewed by David Fetter

--
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
@ 2017-03-10 13:08                                                   ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-21 21:23                                                     ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  2017-03-24 14:12                                                     ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  0 siblings, 2 replies; 84+ messages in thread

From: Alexander Korotkov @ 2017-03-10 13:08 UTC (permalink / raw)
  To: Ashutosh Sharma <ashu.coek88@gmail.com>; +Cc: Simon Riggs <simon@2ndquadrant.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Fri, Mar 10, 2017 at 4:01 PM, Ashutosh Sharma <ashu.coek88@gmail.com>
wrote:

> > I agree.  Probably Simon's patch for reducing pgxact access could negate
> > regression in pgxact alignment patch.
> > Ashutosh, could please you run read-write and read-only tests when both
> > these patches applied?
>
> I already had the results with both the patches applied. But, as I was not
> quite
> able to understand on how Simon's patch for reducing pgxact access could
> negate the regression on read-write workload that we saw with
> pgxact-align-3
> patch earlier, I was slightly hesitant to share the results. Anyways, here
> are
> the results with combined patches on readonly and readwrite workload:
>
> 1) Results for read-only workload:
> ========================
> pgbench -i -s 300 postgres
> pgbench -M prepared -c $thread -j $thread -T $time_for_reading -S postgres
>
> where, time_for_reading = 10mins
> *non default param:*
> shared_buffers=8GB
> max_connections=300
>
> CLIENT COUNT TPS (HEAD) TPS (PATCH) % IMPROVEMENT
> 4 36333 36835 1.381664052
> 8 70179 72496 3.301557446
> 16 169303 175743 3.803831001
> 32 328837 341093 3.727074508
> 64 363352 399847 10.04397939
> 72 372011 413437 11.13569222
> 128 443979 578355 30.26629638
> 180 321420 552373 71.85396055
> 196 276780 558896 101.927885
> 256 234563 568951 142.5578629
>
> 2) Results for read-write workload:
> =========================
> pgbench -i -s 300 postgres
> pgbench -M prepared -c $thread -j $thread -T $time_for_reading  postgres
>
> where, time_for_reading = 30mins
>
> non default param:
> shared_buffers=8GB
> max_connections=300
>
>
> CLIENT COUNT TPS (HEAD) TPS (PATCH) % IMPROVEMENT
> 4 2683 2690 0.2609019754
> 8 5321 5332 0.2067280586
> 16 10348 10387 0.3768844221
> 32 19446 19754 1.58387329
> 64 28178 28198 0.0709773582
> 72 28296 28639 1.212185468
> 128 28577 28600 0.0804843056
> 180 26665 27525 3.225201575
> 196 27628 28511 3.19603301
> 256 28467 28529 0.2177960445
>

Results look good for me.  Idea of committing both of patches looks
attractive.
We have pretty much acceleration for read-only case and small acceleration
for read-write case.
I'll run benchmark on 72-cores machine as well.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 13:08                                                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-03-21 21:23                                                     ` David Steele <david@pgmasters.net>
  2017-03-25 16:35                                                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  1 sibling, 1 reply; 84+ messages in thread

From: David Steele @ 2017-03-21 21:23 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; Ashutosh Sharma <ashu.coek88@gmail.com>; +Cc: Simon Riggs <simon@2ndquadrant.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

Hi Alexander

On 3/10/17 8:08 AM, Alexander Korotkov wrote:

> Results look good for me.  Idea of committing both of patches looks
> attractive.
> We have pretty much acceleration for read-only case and small
> acceleration for read-write case.
> I'll run benchmark on 72-cores machine as well.

Have you had a chance to run those tests yet?

Thanks,
-- 
-David
david@pgmasters.net


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 13:08                                                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-21 21:23                                                     ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
@ 2017-03-25 16:35                                                       ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-03 18:58                                                         ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  0 siblings, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2017-03-25 16:35 UTC (permalink / raw)
  To: David Steele <david@pgmasters.net>; +Cc: Ashutosh Sharma <ashu.coek88@gmail.com>; Simon Riggs <simon@2ndquadrant.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Wed, Mar 22, 2017 at 12:23 AM, David Steele <david@pgmasters.net> wrote:

> Hi Alexander
>
> On 3/10/17 8:08 AM, Alexander Korotkov wrote:
>
> Results look good for me.  Idea of committing both of patches looks
>> attractive.
>> We have pretty much acceleration for read-only case and small
>> acceleration for read-write case.
>> I'll run benchmark on 72-cores machine as well.
>>
>
> Have you had a chance to run those tests yet?
>

I discovered an interesting issue.
I found that ccce90b3 (which was reverted) gives almost same effect as
PGXACT alignment on read-only test on 72-cores machine.
That shouldn't be related to the functionality of ccce90b3 itself, because
read-only test don't do anything with clog.  And that appears to be true.
Padding of PGPROC gives same positive effect as ccce90b3.  Padding patch
(pgproc-pad.patch) is attached.  It's curious that padding changes size of
PGPROC from 816 bytes to 848 bytes.  So, size of PGPROC remains 16-byte
aligned.  So, probably effect is related to distance between PGPROC
members...

See comparison of 16-bytes alignment of PGXACT + reduce PGXACT access vs.
padding of PGPROC.

+-----------+-----------------------------+-----------------------------+-----------------------------+
|           |           master            |pgxact-align16+reduce-access |
      pgproc-pad          |
|   clients |       1 |       2 |       3 |       1 |       2 |       3 |
    1 |       2 |       3 |
|-----------+---------+---------+---------+---------+---------+---------+---------+---------+---------|
|         1 |   31765 |   31100 |   32961 |   32744 |   30024 |   32165 |
31831 |   31710 |   32063 |
|         2 |   58784 |   60347 |   59438 |   58900 |   60846 |   58578 |
57006 |   58875 |   59738 |
|         4 |  112786 |  116346 |  116513 |  114393 |  115238 |  116982 |
 112964 |  112910 |  114248 |
|         8 |  216363 |  217180 |  220492 |  220160 |  213277 |  222844 |
 219578 |  217326 |  221533 |
|        16 |  430783 |  428994 |  405667 |  441594 |  437152 |  434521 |
 429309 |  430169 |  425734 |
|        20 |  531794 |  530932 |  530881 |  546216 |  536639 |  538384 |
 537205 |  529382 |  535287 |
|        40 |  951640 |  930171 |  915583 |  958039 |  831028 |  932284 |
 951259 |  960069 |  955081 |
|        60 | 1087248 | 1085500 | 1082603 | 1108364 | 1117380 | 1119477 |
1123136 | 1108958 | 1121190 |
|        80 | 1249524 | 1253363 | 1254437 | 1256894 | 1241449 | 1277724 |
1258509 | 1270440 | 1261364 |
|       100 | 1384761 | 1390181 | 1390948 | 1370966 | 1365666 | 1361546 |
1424189 | 1404768 | 1417215 |
|       120 | 1440615 | 1442773 | 1434149 | 1545179 | 1527888 | 1533981 |
1577170 | 1569765 | 1566950 |
|       140 | 1400715 | 1411922 | 1406841 | 1692305 | 1695125 | 1661440 |
1726416 | 1707735 | 1713590 |
|       150 | 1335935 | 1342888 | 1340833 | 1662310 | 1655399 | 1695437 |
1737758 | 1731811 | 1748215 |
|       160 | 1299769 | 1293409 | 1299178 | 1702658 | 1701668 | 1732576 |
1718459 | 1725853 | 1714432 |
|       180 | 1088828 | 1096198 | 1085467 | 1641713 | 1652604 | 1619376 |
1682716 | 1684590 | 1674715 |
|       200 |  994350 |  989267 |  996982 | 1636544 | 1650192 | 1629450 |
1654997 | 1647421 | 1646110 |
|       220 |  920877 |  922182 |  927801 | 1613027 | 1630249 | 1635628 |
1579957 | 1570928 | 1576457 |
|       240 |  887654 |  890656 |  881243 | 1565544 | 1574255 | 1570622 |
1486611 | 1496031 | 1497658 |
+-----------+---------+---------+---------+---------+---------+---------+---------+---------+---------+

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

scalability-pgxact-pgproc-pad.png (image/png, 141.6K) download view image
pgproc-pad.patch (application/octet-stream, 555B) download diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h new file mode 100644 index 1b345fa..d589e72 *** a/src/include/storage/proc.h --- b/src/include/storage/proc.h *************** struct PGPROC *** 188,193 **** --- 188,195 ---- PGPROC *lockGroupLeader; /* lock group leader, if I'm a member */ dlist_head lockGroupMembers; /* list of members, if I'm a leader */ dlist_node lockGroupLink; /* my member link, if I'm a member */ + + char pad[32]; }; /* NOTE: "typedef struct PGPROC PGPROC" appears in storage/lock.h. */
^ permalink raw reply [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 13:08                                                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-21 21:23                                                     ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  2017-03-25 16:35                                                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-04-03 18:58                                                         ` Andres Freund <andres@anarazel.de>
  2017-04-03 23:19                                                           ` Re: Should we cacheline align PGXACT? Jim Van Fleet <vanfleet@us.ibm.com>
  2017-04-04 12:55                                                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  0 siblings, 2 replies; 84+ messages in thread

From: Andres Freund @ 2017-04-03 18:58 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: David Steele <david@pgmasters.net>; Ashutosh Sharma <ashu.coek88@gmail.com>; Simon Riggs <simon@2ndquadrant.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On 2017-03-25 19:35:35 +0300, Alexander Korotkov wrote:
> On Wed, Mar 22, 2017 at 12:23 AM, David Steele <david@pgmasters.net> wrote:
> 
> > Hi Alexander
> >
> > On 3/10/17 8:08 AM, Alexander Korotkov wrote:
> >
> > Results look good for me.  Idea of committing both of patches looks
> >> attractive.
> >> We have pretty much acceleration for read-only case and small
> >> acceleration for read-write case.
> >> I'll run benchmark on 72-cores machine as well.
> >>
> >
> > Have you had a chance to run those tests yet?
> >
> 
> I discovered an interesting issue.
> I found that ccce90b3 (which was reverted) gives almost same effect as
> PGXACT alignment on read-only test on 72-cores machine.

That's possibly because it changes alignment?


> That shouldn't be related to the functionality of ccce90b3 itself, because
> read-only test don't do anything with clog.  And that appears to be true.
> Padding of PGPROC gives same positive effect as ccce90b3.  Padding patch
> (pgproc-pad.patch) is attached.  It's curious that padding changes size of
> PGPROC from 816 bytes to 848 bytes.  So, size of PGPROC remains 16-byte
> aligned.  So, probably effect is related to distance between PGPROC
> members...
> 
> See comparison of 16-bytes alignment of PGXACT + reduce PGXACT access vs.
> padding of PGPROC.

My earlier testing had showed that padding everything is the best
approach :/


I'm inclined to push this to the next CF, it seems we need a lot more
benchmarking here.

Greetings,

Andres Freund


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 13:08                                                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-21 21:23                                                     ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  2017-03-25 16:35                                                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-03 18:58                                                         ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
@ 2017-04-03 23:19                                                           ` Jim Van Fleet <vanfleet@us.ibm.com>
  1 sibling, 0 replies; 84+ messages in thread

From: Jim Van Fleet @ 2017-04-03 23:19 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>; David Steele <david@pgmasters.net>; Ashutosh Sharma <ashu.coek88@gmail.com>; Simon Riggs <simon@2ndquadrant.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

pgsql-hackers-owner@postgresql.org wrote on 04/03/2017 01:58:03 PM:

> From: Andres Freund <andres@anarazel.de>
> To: Alexander Korotkov <a.korotkov@postgrespro.ru>
> Cc: David Steele <david@pgmasters.net>, Ashutosh Sharma 
> <ashu.coek88@gmail.com>, Simon Riggs <simon@2ndquadrant.com>, Alvaro
> Herrera <alvherre@2ndquadrant.com>, Robert Haas 
> <robertmhaas@gmail.com>, Bernd Helmle <mailings@oopsware.de>, Tomas 
> Vondra <tomas.vondra@2ndquadrant.com>, pgsql-hackers <pgsql-
> hackers@postgresql.org>
> Date: 04/03/2017 01:59 PM
> Subject: Re: [HACKERS] Should we cacheline align PGXACT?
> Sent by: pgsql-hackers-owner@postgresql.org
> 
> On 2017-03-25 19:35:35 +0300, Alexander Korotkov wrote:
> > On Wed, Mar 22, 2017 at 12:23 AM, David Steele <david@pgmasters.net> 
wrote:
> > 
> > > Hi Alexander
> > >
> > > On 3/10/17 8:08 AM, Alexander Korotkov wrote:
> > >
> > > Results look good for me.  Idea of committing both of patches looks
> > >> attractive.
> > >> We have pretty much acceleration for read-only case and small
> > >> acceleration for read-write case.
> > >> I'll run benchmark on 72-cores machine as well.
> > >>
> > >
> > > Have you had a chance to run those tests yet?
> > >
> > 
> > I discovered an interesting issue.
> > I found that ccce90b3 (which was reverted) gives almost same effect as
> > PGXACT alignment on read-only test on 72-cores machine.
> 
> That's possibly because it changes alignment?
> 
> 
> > That shouldn't be related to the functionality of ccce90b3 itself, 
because
> > read-only test don't do anything with clog.  And that appears to be 
true.
> > Padding of PGPROC gives same positive effect as ccce90b3.  Padding 
patch
> > (pgproc-pad.patch) is attached.  It's curious that padding changes 
size of
> > PGPROC from 816 bytes to 848 bytes.  So, size of PGPROC remains 
16-byte
> > aligned.  So, probably effect is related to distance between PGPROC
> > members...
> > 
> > See comparison of 16-bytes alignment of PGXACT + reduce PGXACT access 
vs.
> > padding of PGPROC.
> 
> My earlier testing had showed that padding everything is the best
> approach :/
>
My approach has been to, generally, pad "everything" as well.  In my 
testing on power, I padded  PGXACT to 16 bytes.  To my surprise, with the 
padding in isolation, the performance (on hammerdb) was slightly degraded.

Jim Van Fleet 
> 
> I'm inclined to push this to the next CF, it seems we need a lot more
> benchmarking here.
> 
> Greetings,
> 
> Andres Freund
> 
> 
> -- 
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
> 

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 13:08                                                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-21 21:23                                                     ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  2017-03-25 16:35                                                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-03 18:58                                                         ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
@ 2017-04-04 12:55                                                           ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-04 12:58                                                             ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  1 sibling, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2017-04-04 12:55 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: David Steele <david@pgmasters.net>; Ashutosh Sharma <ashu.coek88@gmail.com>; Simon Riggs <simon@2ndquadrant.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Mon, Apr 3, 2017 at 9:58 PM, Andres Freund <andres@anarazel.de> wrote:

> On 2017-03-25 19:35:35 +0300, Alexander Korotkov wrote:
> > On Wed, Mar 22, 2017 at 12:23 AM, David Steele <david@pgmasters.net>
> wrote:
> >
> > > Hi Alexander
> > >
> > > On 3/10/17 8:08 AM, Alexander Korotkov wrote:
> > >
> > > Results look good for me.  Idea of committing both of patches looks
> > >> attractive.
> > >> We have pretty much acceleration for read-only case and small
> > >> acceleration for read-write case.
> > >> I'll run benchmark on 72-cores machine as well.
> > >>
> > >
> > > Have you had a chance to run those tests yet?
> > >
> >
> > I discovered an interesting issue.
> > I found that ccce90b3 (which was reverted) gives almost same effect as
> > PGXACT alignment on read-only test on 72-cores machine.
>
> That's possibly because it changes alignment?
>

Probably, that needs to be checked.

> That shouldn't be related to the functionality of ccce90b3 itself, because
> > read-only test don't do anything with clog.  And that appears to be true.
> > Padding of PGPROC gives same positive effect as ccce90b3.  Padding patch
> > (pgproc-pad.patch) is attached.  It's curious that padding changes size
> of
> > PGPROC from 816 bytes to 848 bytes.  So, size of PGPROC remains 16-byte
> > aligned.  So, probably effect is related to distance between PGPROC
> > members...
> >
> > See comparison of 16-bytes alignment of PGXACT + reduce PGXACT access vs.
> > padding of PGPROC.
>
> My earlier testing had showed that padding everything is the best
> approach :/
>
>
> I'm inclined to push this to the next CF, it seems we need a lot more
> benchmarking here.
>

No objections.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 13:08                                                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-21 21:23                                                     ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  2017-03-25 16:35                                                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-03 18:58                                                         ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2017-04-04 12:55                                                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-04-04 12:58                                                             ` David Steele <david@pgmasters.net>
  2017-04-04 13:05                                                               ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-09-05 11:47                                                               ` Re: Should we cacheline align PGXACT? Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 2 replies; 84+ messages in thread

From: David Steele @ 2017-04-04 12:58 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; Andres Freund <andres@anarazel.de>; +Cc: Ashutosh Sharma <ashu.coek88@gmail.com>; Simon Riggs <simon@2ndquadrant.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On 4/4/17 8:55 AM, Alexander Korotkov wrote:
> On Mon, Apr 3, 2017 at 9:58 PM, Andres Freund <andres@anarazel.de
> 
>     I'm inclined to push this to the next CF, it seems we need a lot more
>     benchmarking here.
> 
> 
> No objections.

This submission has been moved to CF 2017-07.

Thanks,
-- 
-David
david@pgmasters.net


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 13:08                                                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-21 21:23                                                     ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  2017-03-25 16:35                                                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-03 18:58                                                         ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2017-04-04 12:55                                                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-04 12:58                                                             ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
@ 2017-04-04 13:05                                                               ` Simon Riggs <simon@2ndquadrant.com>
  1 sibling, 0 replies; 84+ messages in thread

From: Simon Riggs @ 2017-04-04 13:05 UTC (permalink / raw)
  To: David Steele <david@pgmasters.net>; +Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>; Andres Freund <andres@anarazel.de>; Ashutosh Sharma <ashu.coek88@gmail.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On 4 April 2017 at 08:58, David Steele <david@pgmasters.net> wrote:
> On 4/4/17 8:55 AM, Alexander Korotkov wrote:
>> On Mon, Apr 3, 2017 at 9:58 PM, Andres Freund <andres@anarazel.de
>>
>>     I'm inclined to push this to the next CF, it seems we need a lot more
>>     benchmarking here.
>>
>>
>> No objections.
>
> This submission has been moved to CF 2017-07.

Please note that I'm expecting to re-commit my earlier patch once
fixed up, since it had all-positive test results.

-- 
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 13:08                                                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-21 21:23                                                     ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  2017-03-25 16:35                                                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-03 18:58                                                         ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2017-04-04 12:55                                                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-04 12:58                                                             ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
@ 2017-09-05 11:47                                                               ` Daniel Gustafsson <daniel@yesql.se>
  2017-09-15 23:51                                                                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  1 sibling, 1 reply; 84+ messages in thread

From: Daniel Gustafsson @ 2017-09-05 11:47 UTC (permalink / raw)
  To: David Steele <david@pgmasters.net>; Alexander Korotkov <a.korotkov@postgrespro.ru>; Andres Freund <andres@anarazel.de>; Ashutosh Sharma <ashu.coek88@gmail.com>; Simon Riggs <simon@2ndquadrant.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; +Cc: pgsql-hackers

> On 04 Apr 2017, at 14:58, David Steele <david@pgmasters.net> wrote:
> 
> On 4/4/17 8:55 AM, Alexander Korotkov wrote:
>> On Mon, Apr 3, 2017 at 9:58 PM, Andres Freund <andres@anarazel.de
>> 
>>    I'm inclined to push this to the next CF, it seems we need a lot more
>>    benchmarking here.
>> 
>> No objections.
> 
> This submission has been moved to CF 2017-07.

This CF has now started (well, 201709 but that’s what was meant in above), can
we reach closure on this patch in this CF?

cheers ./daniel

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 13:08                                                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-21 21:23                                                     ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  2017-03-25 16:35                                                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-03 18:58                                                         ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2017-04-04 12:55                                                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-04 12:58                                                             ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  2017-09-05 11:47                                                               ` Re: Should we cacheline align PGXACT? Daniel Gustafsson <daniel@yesql.se>
@ 2017-09-15 23:51                                                                 ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-09-18 09:41                                                                   ` Re: Should we cacheline align PGXACT? Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2017-09-15 23:51 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: David Steele <david@pgmasters.net>; Andres Freund <andres@anarazel.de>; Ashutosh Sharma <ashu.coek88@gmail.com>; Simon Riggs <simon@2ndquadrant.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Tue, Sep 5, 2017 at 2:47 PM, Daniel Gustafsson <daniel@yesql.se> wrote:

> > On 04 Apr 2017, at 14:58, David Steele <david@pgmasters.net> wrote:
> >
> > On 4/4/17 8:55 AM, Alexander Korotkov wrote:
> >> On Mon, Apr 3, 2017 at 9:58 PM, Andres Freund <andres@anarazel.de
> >>
> >>    I'm inclined to push this to the next CF, it seems we need a lot more
> >>    benchmarking here.
> >>
> >> No objections.
> >
> > This submission has been moved to CF 2017-07.
>
> This CF has now started (well, 201709 but that’s what was meant in above),
> can
> we reach closure on this patch in this CF?
>

During previous commitfest I come to doubts if this patch is really needed
when same effect could be achieved by another (perhaps random) change of
alignment.  The thing I can do now is to retry my benchmark on current
master and check what effect this patch has now.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 13:08                                                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-21 21:23                                                     ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  2017-03-25 16:35                                                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-03 18:58                                                         ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2017-04-04 12:55                                                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-04 12:58                                                             ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  2017-09-05 11:47                                                               ` Re: Should we cacheline align PGXACT? Daniel Gustafsson <daniel@yesql.se>
  2017-09-15 23:51                                                                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-09-18 09:41                                                                   ` Daniel Gustafsson <daniel@yesql.se>
  2017-09-21 09:08                                                                     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  0 siblings, 1 reply; 84+ messages in thread

From: Daniel Gustafsson @ 2017-09-18 09:41 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: David Steele <david@pgmasters.net>; Andres Freund <andres@anarazel.de>; Ashutosh Sharma <ashu.coek88@gmail.com>; Simon Riggs <simon@2ndquadrant.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

> On 16 Sep 2017, at 01:51, Alexander Korotkov <a.korotkov@postgrespro.ru> wrote:
> 
> On Tue, Sep 5, 2017 at 2:47 PM, Daniel Gustafsson <daniel@yesql.se <mailto:daniel@yesql.se>> wrote:
> > On 04 Apr 2017, at 14:58, David Steele <david@pgmasters.net <mailto:david@pgmasters.net>> wrote:
> >
> > On 4/4/17 8:55 AM, Alexander Korotkov wrote:
> >> On Mon, Apr 3, 2017 at 9:58 PM, Andres Freund <andres@anarazel.de <mailto:andres@anarazel.de>
> >>
> >>    I'm inclined to push this to the next CF, it seems we need a lot more
> >>    benchmarking here.
> >>
> >> No objections.
> >
> > This submission has been moved to CF 2017-07.
> 
> This CF has now started (well, 201709 but that’s what was meant in above), can
> we reach closure on this patch in this CF?
> 
> During previous commitfest I come to doubts if this patch is really needed when same effect could be achieved by another (perhaps random) change of alignment.  The thing I can do now is to retry my benchmark on current master and check what effect this patch has now.

Considering this I’ll mark this as Waiting on Author, in case you come to
conclusion that another patch is required then we’ll bump to a return status.

cheers ./daniel 

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 13:08                                                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-21 21:23                                                     ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  2017-03-25 16:35                                                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-03 18:58                                                         ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2017-04-04 12:55                                                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-04 12:58                                                             ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  2017-09-05 11:47                                                               ` Re: Should we cacheline align PGXACT? Daniel Gustafsson <daniel@yesql.se>
  2017-09-15 23:51                                                                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-09-18 09:41                                                                   ` Re: Should we cacheline align PGXACT? Daniel Gustafsson <daniel@yesql.se>
@ 2017-09-21 09:08                                                                     ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-09-22 11:07                                                                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  0 siblings, 1 reply; 84+ messages in thread

From: Alexander Korotkov @ 2017-09-21 09:08 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: David Steele <david@pgmasters.net>; Andres Freund <andres@anarazel.de>; Ashutosh Sharma <ashu.coek88@gmail.com>; Simon Riggs <simon@2ndquadrant.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Mon, Sep 18, 2017 at 12:41 PM, Daniel Gustafsson <daniel@yesql.se> wrote:

> > On 16 Sep 2017, at 01:51, Alexander Korotkov <a.korotkov@postgrespro.ru>
> wrote:
> >
> > On Tue, Sep 5, 2017 at 2:47 PM, Daniel Gustafsson <daniel@yesql.se
> <mailto:daniel@yesql.se>> wrote:
> > > On 04 Apr 2017, at 14:58, David Steele <david@pgmasters.net <mailto:
> david@pgmasters.net>> wrote:
> > >
> > > On 4/4/17 8:55 AM, Alexander Korotkov wrote:
> > >> On Mon, Apr 3, 2017 at 9:58 PM, Andres Freund <andres@anarazel.de
> <mailto:andres@anarazel.de>
> > >>
> > >>    I'm inclined to push this to the next CF, it seems we need a lot
> more
> > >>    benchmarking here.
> > >>
> > >> No objections.
> > >
> > > This submission has been moved to CF 2017-07.
> >
> > This CF has now started (well, 201709 but that’s what was meant in
> above), can
> > we reach closure on this patch in this CF?
> >
> > During previous commitfest I come to doubts if this patch is really
> needed when same effect could be achieved by another (perhaps random)
> change of alignment.  The thing I can do now is to retry my benchmark on
> current master and check what effect this patch has now.
>
> Considering this I’ll mark this as Waiting on Author, in case you come to
> conclusion that another patch is required then we’ll bump to a return
> status.
>

I've made some read-only benchmarking.  There is clear win in this case.
The only point where median of master is higher than median of patched
version is 40 clients.

In this point observations are following:
master:       982432 939483 932075
pgxact-align: 913151 921300 938132
So, groups of observations form the overlapping ranges, and this anomaly
can be explained by statistical error.

I'm going to make some experiments with read-write and mixed workloads too.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

scalability.png (image/png, 40.7K) download view image
^ permalink raw reply [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 13:08                                                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-21 21:23                                                     ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  2017-03-25 16:35                                                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-03 18:58                                                         ` Re: Should we cacheline align PGXACT? Andres Freund <andres@anarazel.de>
  2017-04-04 12:55                                                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-04-04 12:58                                                             ` Re: Should we cacheline align PGXACT? David Steele <david@pgmasters.net>
  2017-09-05 11:47                                                               ` Re: Should we cacheline align PGXACT? Daniel Gustafsson <daniel@yesql.se>
  2017-09-15 23:51                                                                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-09-18 09:41                                                                   ` Re: Should we cacheline align PGXACT? Daniel Gustafsson <daniel@yesql.se>
  2017-09-21 09:08                                                                     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-09-22 11:07                                                                       ` Alexander Korotkov <a.korotkov@postgrespro.ru>
  0 siblings, 0 replies; 84+ messages in thread

From: Alexander Korotkov @ 2017-09-22 11:07 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: David Steele <david@pgmasters.net>; Andres Freund <andres@anarazel.de>; Ashutosh Sharma <ashu.coek88@gmail.com>; Simon Riggs <simon@2ndquadrant.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Thu, Sep 21, 2017 at 12:08 PM, Alexander Korotkov <
a.korotkov@postgrespro.ru> wrote:

> On Mon, Sep 18, 2017 at 12:41 PM, Daniel Gustafsson <daniel@yesql.se>
> wrote:
>
>> > On 16 Sep 2017, at 01:51, Alexander Korotkov <a.korotkov@postgrespro.ru>
>> wrote:
>> >
>> > On Tue, Sep 5, 2017 at 2:47 PM, Daniel Gustafsson <daniel@yesql.se
>> <mailto:daniel@yesql.se>> wrote:
>> > > On 04 Apr 2017, at 14:58, David Steele <david@pgmasters.net <mailto:
>> david@pgmasters.net>> wrote:
>> > >
>> > > On 4/4/17 8:55 AM, Alexander Korotkov wrote:
>> > >> On Mon, Apr 3, 2017 at 9:58 PM, Andres Freund <andres@anarazel.de
>> <mailto:andres@anarazel.de>
>> > >>
>> > >>    I'm inclined to push this to the next CF, it seems we need a lot
>> more
>> > >>    benchmarking here.
>> > >>
>> > >> No objections.
>> > >
>> > > This submission has been moved to CF 2017-07.
>> >
>> > This CF has now started (well, 201709 but that’s what was meant in
>> above), can
>> > we reach closure on this patch in this CF?
>> >
>> > During previous commitfest I come to doubts if this patch is really
>> needed when same effect could be achieved by another (perhaps random)
>> change of alignment.  The thing I can do now is to retry my benchmark on
>> current master and check what effect this patch has now.
>>
>> Considering this I’ll mark this as Waiting on Author, in case you come to
>> conclusion that another patch is required then we’ll bump to a return
>> status.
>>
>
> I've made some read-only benchmarking.  There is clear win in this case.
> The only point where median of master is higher than median of patched
> version is 40 clients.
>
> In this point observations are following:
> master:       982432 939483 932075
> pgxact-align: 913151 921300 938132
> So, groups of observations form the overlapping ranges, and this anomaly
> can be explained by statistical error.
>
> I'm going to make some experiments with read-write and mixed workloads too.
>

I've made benchmarks with two more workloads.
scalability-rw.png – read-write tcpb-like workload (pgbench default)
scalability-rrw.png – 90% read-only transactions 10% read-write
transactions (-btpcb-like@1 -bselect-only@9)
It became clear that this patch causes regression.  On pure read-write
workload, it's not so evident due to high variability of observations.
However, on mixed workload it's very clear regression.
I would be ridiculous to consider patch which improves read-only
performance but degrades read-write performance in nearly same degree.
Thus, this topic needs more investigation if it's possible to at least get
the same benefit on read-only workload without penalty on read-write
workload (ideally read-write workload should benefit too).  I'm going to
mark this patch as "returned with feedback".

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

scalability-rw.png (image/png, 47.2K) download view image
scalability-rrw.png (image/png, 39.4K) download view image
^ permalink raw reply [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 13:08                                                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
@ 2017-03-24 14:12                                                     ` Simon Riggs <simon@2ndquadrant.com>
  2017-03-24 15:38                                                       ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  1 sibling, 1 reply; 84+ messages in thread

From: Simon Riggs @ 2017-03-24 14:12 UTC (permalink / raw)
  To: Alexander Korotkov <a.korotkov@postgrespro.ru>; +Cc: Ashutosh Sharma <ashu.coek88@gmail.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Robert Haas <robertmhaas@gmail.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On 10 March 2017 at 13:08, Alexander Korotkov <a.korotkov@postgrespro.ru>
wrote:

Results look good for me.  Idea of committing both of patches looks
> attractive.
>

I'll commit mine since I understand what it does. I'll look at the other
one also, but won't commit yet.


> We have pretty much acceleration for read-only case and small acceleration
> for read-write case.
> I'll run benchmark on 72-cores machine as well.
>

No need to wait for that.

-- 
Simon Riggs                http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/;
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2016-08-20 18:38   ` Re: Should we cacheline align PGXACT? Tom Lane <tgl@sss.pgh.pa.us>
  2017-01-30 10:15     ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-10 23:28       ` Re: Should we cacheline align PGXACT? Tomas Vondra <tomas.vondra@2ndquadrant.com>
  2017-02-13 12:34         ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 13:55           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-13 16:13             ` Re: Should we cacheline align PGXACT? Bernd Helmle <mailings@oopsware.de>
  2017-02-13 17:02               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-15 08:49                 ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 14:52                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-15 17:49                     ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-16 10:07                       ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-16 13:58                         ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
  2017-02-17 09:23                           ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-02-22 21:14                             ` Re: Should we cacheline align PGXACT? Alvaro Herrera <alvherre@2ndquadrant.com>
  2017-02-24 04:41                               ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-24 05:11                                 ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-02-24 06:52                                   ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 11:34                                     ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-02-28 18:14                                       ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 04:50                                         ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-01 11:59                                           ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
  2017-03-01 15:44                                             ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 09:30                                               ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-10 13:01                                                 ` Re: Should we cacheline align PGXACT? Ashutosh Sharma <ashu.coek88@gmail.com>
  2017-03-10 13:08                                                   ` Re: Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2017-03-24 14:12                                                     ` Re: Should we cacheline align PGXACT? Simon Riggs <simon@2ndquadrant.com>
@ 2017-03-24 15:38                                                       ` Robert Haas <robertmhaas@gmail.com>
  0 siblings, 0 replies; 84+ messages in thread

From: Robert Haas @ 2017-03-24 15:38 UTC (permalink / raw)
  To: Simon Riggs <simon@2ndquadrant.com>; +Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>; Ashutosh Sharma <ashu.coek88@gmail.com>; Alvaro Herrera <alvherre@2ndquadrant.com>; Bernd Helmle <mailings@oopsware.de>; Tomas Vondra <tomas.vondra@2ndquadrant.com>; pgsql-hackers

On Fri, Mar 24, 2017 at 10:12 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
> On 10 March 2017 at 13:08, Alexander Korotkov <a.korotkov@postgrespro.ru>
> wrote:
>> Results look good for me.  Idea of committing both of patches looks
>> attractive.
>
> I'll commit mine since I understand what it does. I'll look at the other one
> also, but won't commit yet.

Might've been nice to include reviewers, testers, and a link to the
mailing list discussion in the commit message.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread

* Re: Should we cacheline align PGXACT?
  2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
  2016-08-20 18:33 ` Re: Should we cacheline align PGXACT? Robert Haas <robertmhaas@gmail.com>
@ 2016-08-22 02:17   ` Andres Freund <andres@anarazel.de>
  1 sibling, 0 replies; 84+ messages in thread

From: Andres Freund @ 2016-08-22 02:17 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>; pgsql-hackers

On 2016-08-20 14:33:13 -0400, Robert Haas wrote:
> On Aug 19, 2016, at 2:12 AM, Alexander Korotkov <a.korotkov@postgrespro.ru> wrote:
> > Hackers,
> > 
> > originally this idea was proposed by Andres Freund while experimenting with lockfree Pin/UnpinBuffer [1].
> > The patch is attached as well as results of pgbench -S on 72-cores machine.  As before it shows huge benefit in this case.
> > For sure, we should validate that it doesn't cause performance regression in other cases.  At least we should test read-write and smaller machines.
> > Any other ideas?
> 
> Wow, nice results.  My intuition on why PGXACT helped in the first
> place was that it minimized the number of cache lines that had to be
> touched to take a snapshot. Padding obviously would somewhat increase
> that again, so I can't quite understand why it seems to be
> helping... any idea?

I don't think it's that surprising: PGXACT->xid is written to each
transaction, and ->xmin is often written to multiple times per
transaction. That means that if a PGXACT's cacheline is shared between
backends one write will often first have another CPU flush it's store
buffer / L1 / L2 cache. If there's several hops between two cores, that
can mean quite a bit of added latency.  I previously played around with
*removing* the optimization of resetting ->xmin when not required
anymore - and on a bigger machine it noticeably increased throughput on
higher client counts.

To me it's pretty clear that rounding up PGXACT's size to a 16 bytes
(instead of the current 12, with 4 byte alignment) is going to be a win,
the current approach just leeds to pointless sharing.  Besides, storing
the database oid in there will allow GetOldestXmin() to only use PGXACT,
and could, with a bit more work, allow to ignore other databases in
GetSnapshotData().

I'm less sure that going up to a full cacheline is always a win.

Andres


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



^ permalink  raw  reply  [nested|flat] 84+ messages in thread


end of thread, other threads:[~2017-09-22 11:07 UTC | newest]

Thread overview: 84+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-08-19 06:12 Should we cacheline align PGXACT? Alexander Korotkov <a.korotkov@postgrespro.ru>
2016-08-19 12:19 ` Amit Kapila <amit.kapila16@gmail.com>
2016-08-19 14:54   ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2016-08-20 02:50     ` Amit Kapila <amit.kapila16@gmail.com>
2016-08-19 13:46 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-08-19 14:50   ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2016-08-19 15:46     ` Tom Lane <tgl@sss.pgh.pa.us>
2016-08-22 02:40   ` Andres Freund <andres@anarazel.de>
2016-08-22 03:25     ` Craig Ringer <craig@2ndquadrant.com>
2016-08-22 05:24       ` Andres Freund <andres@anarazel.de>
2017-02-13 01:57         ` Jim Nasby <Jim.Nasby@BlueTreble.com>
2016-08-20 18:33 ` Robert Haas <robertmhaas@gmail.com>
2016-08-20 18:38   ` Tom Lane <tgl@sss.pgh.pa.us>
2017-01-30 10:15     ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-02-10 23:28       ` Tomas Vondra <tomas.vondra@2ndquadrant.com>
2017-02-11 01:44         ` Ashutosh Sharma <ashu.coek88@gmail.com>
2017-02-11 01:54           ` Tomas Vondra <tomas.vondra@2ndquadrant.com>
2017-02-11 14:04             ` Ashutosh Sharma <ashu.coek88@gmail.com>
2017-02-11 12:21         ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-02-11 13:17           ` Tomas Vondra <tomas.vondra@2ndquadrant.com>
2017-02-11 18:31             ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-02-13 12:34         ` Bernd Helmle <mailings@oopsware.de>
2017-02-13 13:55           ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-02-13 16:07             ` Alvaro Herrera <alvherre@2ndquadrant.com>
2017-02-14 12:00               ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-02-14 12:57                 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2017-02-14 13:06                   ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-02-14 14:13                     ` Alvaro Herrera <alvherre@2ndquadrant.com>
2017-02-15 16:43               ` Robert Haas <robertmhaas@gmail.com>
2017-02-15 17:14                 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-02-15 17:24                   ` Robert Haas <robertmhaas@gmail.com>
2017-02-15 17:48                     ` Tom Lane <tgl@sss.pgh.pa.us>
2017-02-15 18:01                       ` Robert Haas <robertmhaas@gmail.com>
2017-02-15 19:23                     ` Andres Freund <andres@anarazel.de>
2017-02-15 19:15                 ` Andres Freund <andres@anarazel.de>
2017-02-15 19:38                   ` Robert Haas <robertmhaas@gmail.com>
2017-02-20 12:32                   ` Simon Riggs <simon@2ndquadrant.com>
2017-02-20 16:53                     ` Robert Haas <robertmhaas@gmail.com>
2017-02-20 17:19                       ` Simon Riggs <simon@2ndquadrant.com>
2017-02-20 17:32                         ` Robert Haas <robertmhaas@gmail.com>
2017-02-20 17:56                           ` Simon Riggs <simon@2ndquadrant.com>
2017-02-13 16:13             ` Bernd Helmle <mailings@oopsware.de>
2017-02-13 17:02               ` Ashutosh Sharma <ashu.coek88@gmail.com>
2017-02-15 08:49                 ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-02-15 14:52                   ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-02-15 17:49                     ` Alvaro Herrera <alvherre@2ndquadrant.com>
2017-02-16 10:07                       ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-02-16 13:58                         ` Robert Haas <robertmhaas@gmail.com>
2017-02-17 09:23                           ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-02-17 09:44                             ` Ashutosh Sharma <ashu.coek88@gmail.com>
2017-02-17 09:50                               ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-02-20 10:20                               ` Ashutosh Sharma <ashu.coek88@gmail.com>
2017-02-21 10:51                                 ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-02-21 11:27                                   ` Ashutosh Sharma <ashu.coek88@gmail.com>
2017-02-21 11:37                                     ` Andres Freund <andres@anarazel.de>
2017-02-21 12:22                                       ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-02-21 13:03                                         ` Ashutosh Sharma <ashu.coek88@gmail.com>
2017-02-22 21:14                             ` Alvaro Herrera <alvherre@2ndquadrant.com>
2017-02-24 04:41                               ` Ashutosh Sharma <ashu.coek88@gmail.com>
2017-02-24 05:11                                 ` Simon Riggs <simon@2ndquadrant.com>
2017-02-24 06:52                                   ` Ashutosh Sharma <ashu.coek88@gmail.com>
2017-02-28 11:34                                     ` Ashutosh Sharma <ashu.coek88@gmail.com>
2017-02-28 18:14                                       ` Simon Riggs <simon@2ndquadrant.com>
2017-03-01 04:50                                         ` Ashutosh Sharma <ashu.coek88@gmail.com>
2017-03-01 11:59                                           ` Simon Riggs <simon@2ndquadrant.com>
2017-03-01 15:44                                             ` Ashutosh Sharma <ashu.coek88@gmail.com>
2017-03-10 09:30                                               ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-03-10 13:01                                                 ` Ashutosh Sharma <ashu.coek88@gmail.com>
2017-03-10 13:08                                                   ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-03-21 21:23                                                     ` David Steele <david@pgmasters.net>
2017-03-25 16:35                                                       ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-04-03 18:58                                                         ` Andres Freund <andres@anarazel.de>
2017-04-03 23:19                                                           ` Jim Van Fleet <vanfleet@us.ibm.com>
2017-04-04 12:55                                                           ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-04-04 12:58                                                             ` David Steele <david@pgmasters.net>
2017-04-04 13:05                                                               ` Simon Riggs <simon@2ndquadrant.com>
2017-09-05 11:47                                                               ` Daniel Gustafsson <daniel@yesql.se>
2017-09-15 23:51                                                                 ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-09-18 09:41                                                                   ` Daniel Gustafsson <daniel@yesql.se>
2017-09-21 09:08                                                                     ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-09-22 11:07                                                                       ` Alexander Korotkov <a.korotkov@postgrespro.ru>
2017-03-24 14:12                                                     ` Simon Riggs <simon@2ndquadrant.com>
2017-03-24 15:38                                                       ` Robert Haas <robertmhaas@gmail.com>
2016-08-22 02:17   ` Andres Freund <andres@anarazel.de>

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