Skip to content

Commit f2b73cd

Browse files
committed
Measure max wakeup time
1 parent 0267c89 commit f2b73cd

File tree

3 files changed

+53
-11
lines changed

3 files changed

+53
-11
lines changed

contrib/mmts/multimaster.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -519,11 +519,13 @@ MtmAdjustOldestXid(TransactionId xid)
519519
}
520520
}
521521
}
522-
if (prev != NULL) {
523-
Mtm->transListHead = prev;
524-
Mtm->oldestXid = xid = prev->xid;
525-
} else if (TransactionIdPrecedes(Mtm->oldestXid, xid)) {
526-
xid = Mtm->oldestXid;
522+
if (MtmUseDtm) {
523+
if (prev != NULL) {
524+
Mtm->transListHead = prev;
525+
Mtm->oldestXid = xid = prev->xid;
526+
} else if (TransactionIdPrecedes(Mtm->oldestXid, xid)) {
527+
xid = Mtm->oldestXid;
528+
}
527529
}
528530
MtmUnlock();
529531
}
@@ -759,6 +761,8 @@ MtmPrePrepareTransaction(MtmCurrentTrans* x)
759761

760762
}
761763

764+
static time_t maxWakeupTime;
765+
762766
static void
763767
MtmPostPrepareTransaction(MtmCurrentTrans* x)
764768
{
@@ -782,18 +786,17 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
782786
MtmResetTransaction(x);
783787
} else {
784788
time_t wakeupTime;
785-
static time_t maxWakeupTime;
786789
/* wait votes from all nodes */
787790
while (!ts->votingCompleted) {
788791
MtmUnlock();
789792
WaitLatch(&MyProc->procLatch, WL_LATCH_SET, -1);
790793
ResetLatch(&MyProc->procLatch);
794+
wakeupTime = MtmGetCurrentTime() - ts->wakeupTime;
795+
if (wakeupTime > maxWakeupTime) {
796+
maxWakeupTime = wakeupTime;
797+
}
791798
MtmLock(LW_SHARED);
792799
}
793-
wakeupTime = MtmGetCurrentTime() - ts->wakeupTime;
794-
if (wakeupTime > maxWakeupTime) {
795-
maxWakeupTime = wakeupTime;
796-
}
797800
x->status = ts->status;
798801
MTM_LOG3("%d: Result of vote: %d", MyProcPid, ts->status);
799802
MtmUnlock();

contrib/mmts/tests/perf.results

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,42 @@ Bench finished at Чт. апр. 14 18:53:23 MSK 2016
252252
Bench started at Чт. апр. 14 18:53:42 MSK 2016
253253
astro5:{tps:180.239135, transactions:150000, selects:0, updates:300156, aborts:232, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:1000, hosts:3}
254254
Bench finished at Чт. апр. 14 19:07:34 MSK 2016
255+
Bench started at Чт. апр. 14 19:59:58 MSK 2016
256+
astro5:{tps:17844.456298, transactions:150000, selects:0, updates:300152, aborts:240, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:1000, hosts:3}
257+
Bench finished at Чт. апр. 14 20:00:07 MSK 2016
258+
Bench started at Чт. апр. 14 20:01:03 MSK 2016
259+
astro5:{tps:19247.941850, transactions:150000, selects:0, updates:300138, aborts:203, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:1000, hosts:3}
260+
Bench finished at Чт. апр. 14 20:01:11 MSK 2016
261+
Bench started at Чт. апр. 14 20:01:49 MSK 2016
262+
astro5:{tps:18371.053393, transactions:150000, selects:0, updates:300170, aborts:235, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:1000, hosts:3}
263+
Bench finished at Чт. апр. 14 20:01:57 MSK 2016
264+
Bench started at Чт. апр. 14 20:02:23 MSK 2016
265+
astro5:{tps:13404.266927, transactions:100000, selects:0, updates:200058, aborts:97, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:1000, hosts:3}
266+
Bench finished at Чт. апр. 14 20:02:30 MSK 2016
267+
Bench started at Чт. апр. 14 20:03:24 MSK 2016
268+
astro5:{tps:16527.393080, transactions:100000, selects:0, updates:200078, aborts:95, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:1000, hosts:3}
269+
Bench finished at Чт. апр. 14 20:03:31 MSK 2016
270+
Bench started at Чт. апр. 14 20:04:00 MSK 2016
271+
astro5:{tps:18563.630432, transactions:150000, selects:0, updates:300190, aborts:226, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:1000, hosts:3}
272+
Bench finished at Чт. апр. 14 20:04:08 MSK 2016
273+
Bench started at Чт. апр. 14 20:04:49 MSK 2016
274+
astro5:{tps:18701.395074, transactions:150000, selects:0, updates:300168, aborts:236, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:1000, hosts:3}
275+
Bench finished at Чт. апр. 14 20:04:57 MSK 2016
276+
Bench started at Чт. апр. 14 20:05:19 MSK 2016
277+
astro5:{tps:19369.111871, transactions:150000, selects:0, updates:300190, aborts:231, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:1000, hosts:3}
278+
Bench finished at Чт. апр. 14 20:05:27 MSK 2016
279+
Bench started at Чт. апр. 14 20:06:04 MSK 2016
280+
astro5:{tps:19453.975668, transactions:1500000, selects:0, updates:3001868, aborts:2439, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
281+
Bench finished at Чт. апр. 14 20:07:21 MSK 2016
282+
Bench started at Чт. апр. 14 20:08:36 MSK 2016
283+
astro5:{tps:19686.758474, transactions:1500000, selects:0, updates:3001850, aborts:2463, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
284+
Bench finished at Чт. апр. 14 20:09:53 MSK 2016
285+
Bench started at Чт. апр. 14 20:10:09 MSK 2016
286+
astro5:{tps:20577.036061, transactions:1500000, selects:0, updates:3001964, aborts:2467, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
287+
Bench finished at Чт. апр. 14 20:11:23 MSK 2016
288+
Bench started at Чт. апр. 14 20:12:49 MSK 2016
289+
astro5:{tps:16349.624735, transactions:1500000, selects:0, updates:3001828, aborts:2412, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
290+
Bench finished at Чт. апр. 14 20:14:21 MSK 2016
291+
Bench started at Чт. апр. 14 20:14:46 MSK 2016
292+
astro5:{tps:11453.993709, transactions:1500000, selects:0, updates:3001960, aborts:2563, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
293+
Bench finished at Чт. апр. 14 20:16:57 MSK 2016

contrib/mmts/tests/perf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
- name: run transfers
4747
shell: >
4848
~/pg_cluster/install/bin/dtmbench {{connections}}
49-
-w {{ nconns }} -r 0 -n 1000 -a 500000 -p {{ up }} |
49+
-w {{ nconns }} -r 0 -n 10000 -a 500000 -p {{ up }} |
5050
tee -a perf.results |
5151
sed "s/^/`hostname`:/"
5252
register: transfers_result

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy