Skip to content

Commit 0267c89

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

File tree

5 files changed

+76
-10
lines changed

5 files changed

+76
-10
lines changed

contrib/mmts/multimaster.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -519,13 +519,11 @@ MtmAdjustOldestXid(TransactionId xid)
519519
}
520520
}
521521
}
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-
}
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;
529527
}
530528
MtmUnlock();
531529
}
@@ -783,13 +781,19 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
783781
MtmUnlock();
784782
MtmResetTransaction(x);
785783
} else {
784+
time_t wakeupTime;
785+
static time_t maxWakeupTime;
786786
/* wait votes from all nodes */
787787
while (!ts->votingCompleted) {
788788
MtmUnlock();
789789
WaitLatch(&MyProc->procLatch, WL_LATCH_SET, -1);
790790
ResetLatch(&MyProc->procLatch);
791791
MtmLock(LW_SHARED);
792792
}
793+
wakeupTime = MtmGetCurrentTime() - ts->wakeupTime;
794+
if (wakeupTime > maxWakeupTime) {
795+
maxWakeupTime = wakeupTime;
796+
}
793797
x->status = ts->status;
794798
MTM_LOG3("%d: Result of vote: %d", MyProcPid, ts->status);
795799
MtmUnlock();
@@ -980,6 +984,7 @@ void MtmWakeUpBackend(MtmTransState* ts)
980984
{
981985
MTM_LOG3("Wakeup backed procno=%d, pid=%d", ts->procno, ProcGlobal->allProcs[ts->procno].pid);
982986
ts->votingCompleted = true;
987+
ts->wakeupTime = MtmGetCurrentTime();
983988
SetLatch(&ProcGlobal->allProcs[ts->procno].procLatch);
984989
}
985990

contrib/mmts/multimaster.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ typedef struct MtmTransState
135135
int procno; /* pgprocno of transaction coordinator waiting for responses from replicas,
136136
used to notify coordinator by arbiter */
137137
int nSubxids; /* Number of subtransanctions */
138+
time_t wakeupTime;
138139
MtmMessageCode cmd; /* Notification message to be sent */
139140
struct MtmTransState* nextVoting; /* Next element in L1-list of voting transactions. */
140141
struct MtmTransState* next; /* Next element in L1 list of all finished transaction present in xid2state hash */

contrib/mmts/tests/deploy_layouts/cluster.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@
4646
- "wal_sender_timeout = 0"
4747
- "max_replication_slots = 10"
4848
- "max_connections = 200"
49-
- "max_worker_processes = 200"
49+
- "max_worker_processes = 100"
5050
- "shared_preload_libraries = 'raftable,multimaster'"
5151
- "multimaster.conn_strings = '{{connections}}'"
5252
- "multimaster.node_id = {{ node_id }}"
5353
- "multimaster.buffer_size = 65536"
5454
- "multimaster.queue_size = 1073741824"
5555
- "multimaster.arbiter_port = 5600"
5656
- "multimaster.vacuum_delay = 1"
57-
- "multimaster.workers = 100"
57+
- "multimaster.workers = 32"
5858
- "multimaster.use_dtm = 0"
5959

6060
- name: restart postgrespro

contrib/mmts/tests/perf.results

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,63 @@ Bench finished at Чт. апр. 14 15:57:08 MSK 2016
192192
Bench started at Чт. апр. 14 16:07:25 MSK 2016
193193

194194
Bench finished at Чт. апр. 14 16:58:03 MSK 2016
195+
Bench started at Чт. апр. 14 17:14:41 MSK 2016
196+
astro5:{tps:841.620253, transactions:1000000, selects:0, updates:2000610, aborts:1045, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:10000, hosts:3}
197+
Bench finished at Чт. апр. 14 17:34:30 MSK 2016
198+
Bench started at Чт. апр. 14 17:38:52 MSK 2016
199+
astro5:{tps:103207.588648, transactions:100000, selects:200000, updates:0, aborts:0, abort_percent: 0, readers:0, writers:100, update_percent:0, accounts:500000, iterations:1000, hosts:3}
200+
Bench finished at Чт. апр. 14 17:38:53 MSK 2016
201+
Bench started at Чт. апр. 14 17:39:15 MSK 2016
202+
astro5:{tps:600.228131, transactions:100000, selects:0, updates:200058, aborts:94, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:1000, hosts:3}
203+
Bench finished at Чт. апр. 14 17:42:02 MSK 2016
204+
Bench started at Чт. апр. 14 17:47:53 MSK 2016
205+
astro5:{tps:2826.840100, transactions:100000, selects:0, updates:200060, aborts:105, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:1000, hosts:3}
206+
Bench finished at Чт. апр. 14 17:48:28 MSK 2016
207+
Bench started at Чт. апр. 14 17:50:15 MSK 2016
208+
astro5:{tps:1203.074674, transactions:100000, selects:0, updates:200038, aborts:102, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:1000, hosts:3}
209+
Bench finished at Чт. апр. 14 17:51:39 MSK 2016
210+
Bench started at Чт. апр. 14 17:56:22 MSK 2016
211+
astro5:{tps:16673.903141, transactions:100000, selects:0, updates:200044, aborts:68, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:1000, hosts:3}
212+
Bench finished at Чт. апр. 14 17:56:29 MSK 2016
213+
Bench started at Чт. апр. 14 18:01:48 MSK 2016
214+
astro5:{tps:15729.463298, transactions:100000, selects:0, updates:200052, aborts:68, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:1000, hosts:3}
215+
Bench finished at Чт. апр. 14 18:01:55 MSK 2016
216+
Bench started at Чт. апр. 14 18:33:55 MSK 2016
217+
astro5:{tps:16955.322556, transactions:100000, selects:0, updates:200074, aborts:83, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:1000, hosts:3}
218+
Bench finished at Чт. апр. 14 18:34:01 MSK 2016
219+
Bench started at Чт. апр. 14 18:34:29 MSK 2016
220+
astro5:{tps:16920.929961, transactions:150000, selects:0, updates:300194, aborts:187, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:1000, hosts:3}
221+
Bench finished at Чт. апр. 14 18:34:39 MSK 2016
222+
Bench started at Чт. апр. 14 18:35:08 MSK 2016
223+
224+
Bench finished at Чт. апр. 14 18:35:09 MSK 2016
225+
Bench started at Чт. апр. 14 18:35:40 MSK 2016
226+
227+
Bench finished at Чт. апр. 14 18:35:40 MSK 2016
228+
Bench started at Чт. апр. 14 18:36:33 MSK 2016
229+
230+
Bench finished at Чт. апр. 14 18:36:34 MSK 2016
231+
Bench started at Чт. апр. 14 18:38:59 MSK 2016
232+
astro5:{tps:15017.551012, transactions:150000, selects:0, updates:300180, aborts:200, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:1000, hosts:3}
233+
Bench finished at Чт. апр. 14 18:39:09 MSK 2016
234+
Bench started at Чт. апр. 14 18:42:34 MSK 2016
235+
astro5:{tps:6604.488490, transactions:150000, selects:0, updates:300154, aborts:215, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:1000, hosts:3}
236+
Bench finished at Чт. апр. 14 18:42:57 MSK 2016
237+
Bench started at Чт. апр. 14 18:45:11 MSK 2016
238+
astro5:{tps:734.388293, transactions:100000, selects:0, updates:200058, aborts:102, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:1000, hosts:3}
239+
Bench finished at Чт. апр. 14 18:47:28 MSK 2016
240+
Bench started at Чт. апр. 14 18:48:27 MSK 2016
241+
astro5:{tps:2989.544487, transactions:100000, selects:0, updates:200060, aborts:99, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:1000, hosts:3}
242+
Bench finished at Чт. апр. 14 18:49:01 MSK 2016
243+
Bench started at Чт. апр. 14 18:49:34 MSK 2016
244+
astro5:{tps:2579.759122, transactions:100000, selects:0, updates:200066, aborts:99, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:1000, hosts:3}
245+
Bench finished at Чт. апр. 14 18:50:14 MSK 2016
246+
Bench started at Чт. апр. 14 18:50:33 MSK 2016
247+
astro5:{tps:1825.359630, transactions:100000, selects:0, updates:200080, aborts:117, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:1000, hosts:3}
248+
Bench finished at Чт. апр. 14 18:51:28 MSK 2016
249+
Bench started at Чт. апр. 14 18:51:58 MSK 2016
250+
astro5:{tps:1769.625629, transactions:150000, selects:0, updates:300148, aborts:230, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:1000, hosts:3}
251+
Bench finished at Чт. апр. 14 18:53:23 MSK 2016
252+
Bench started at Чт. апр. 14 18:53:42 MSK 2016
253+
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}
254+
Bench finished at Чт. апр. 14 19:07:34 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 10000 -a 500000 -p {{ up }} |
49+
-w {{ nconns }} -r 0 -n 1000 -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