Skip to content

Commit 4a431f9

Browse files
knizhnikkelvich
authored andcommitted
Measure max wakeup time
1 parent 829978c commit 4a431f9

File tree

3 files changed

+53
-11
lines changed

3 files changed

+53
-11
lines changed

multimaster.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,13 @@ MtmAdjustOldestXid(TransactionId xid)
518518
}
519519
}
520520
}
521-
if (prev != NULL) {
522-
Mtm->transListHead = prev;
523-
Mtm->oldestXid = xid = prev->xid;
524-
} else if (TransactionIdPrecedes(Mtm->oldestXid, xid)) {
525-
xid = Mtm->oldestXid;
521+
if (MtmUseDtm) {
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;
527+
}
526528
}
527529
MtmUnlock();
528530
}
@@ -758,6 +760,8 @@ MtmPrePrepareTransaction(MtmCurrentTrans* x)
758760

759761
}
760762

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

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

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