Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf9a1b2a

Browse files
committed
Correctly handle case of equal connections
1 parent7a47f56 commitf9a1b2a

File tree

5 files changed

+13
-29
lines changed

5 files changed

+13
-29
lines changed

‎tests/deploy/cluster.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
pg_version_tag:xtm_patched
1111
pg_destroy_and_init:true
1212
pg_datadir:./postgrespro-data
13+
pg_config_role:
14+
-line:"dtm.vacuum_delay=10"
1315

1416
tasks:
1517

‎tests/deploy/roles/postgres/vars/main.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ pg_config:
2222
-line:"fsync = off"
2323
-line:"autovacuum = off"
2424
-line:"listen_addresses = '*'"
25-
-line:"max_connections =512"
26-
-line:"max_prepared_transactions =400"
25+
-line:"max_connections =2048"
26+
-line:"max_prepared_transactions =4000"
2727
-line:"port = {{pg_port}}"
2828
pg_config_role:
2929
-line:"#pg_config_role"

‎tests/deploy/tsdm.yml‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@
1818
pg_destroy_and_init:true
1919
pg_datadir:~/postgrespro-data2
2020

21-
-role:postgres
22-
pg_port:5434
23-
pg_repo:https://github.com/kelvich/postgresql.git
24-
pg_version_tag:xtm_patched
25-
pg_destroy_and_init:true
26-
pg_datadir:~/postgrespro-data3
27-
2821
tasks:
2922

3023
-name:clone dtm sources
@@ -54,19 +47,9 @@
5447
line:"shared_preload_libraries = 'pg_dtm'"
5548
state:present
5649

57-
-name:enable dtm extension on datanodes
58-
lineinfile:
59-
dest:"~/postgrespro-data3/postgresql.conf"
60-
regexp:"^shared_preload_libraries"
61-
line:"shared_preload_libraries = 'pg_dtm'"
62-
state:present
63-
6450
-name:restart postgrespro1
6551
command:"{{pg_dst}}/bin/pg_ctl restart -w -D ~/postgrespro-data -l ~/postgrespro-data/pg.log"
6652

6753
-name:restart postgrespro2
68-
command:"{{pg_dst}}/bin/pg_ctl restart -w -D ~/postgrespro-data2 -l ~/postgrespro-data/pg.log"
69-
70-
-name:restart postgrespro3
71-
command:"{{pg_dst}}/bin/pg_ctl restart -w -D ~/postgrespro-data3 -l ~/postgrespro-data/pg.log"
54+
command:"{{pg_dst}}/bin/pg_ctl restart -w -D ~/postgrespro-data2 -l ~/postgrespro-data2/pg.log"
7255

‎tests/perf/transfers.go‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,14 @@ func (t TransfersTS) writer(id int, cCommits chan int, cAborts chan int, wg *syn
6767

6868
gtid:=strconv.Itoa(id)+"."+strconv.Itoa(i)
6969
amount:=2*rand.Intn(2)-1
70-
from_acc:=cfg.Writers.StartId+2*id+1
71-
to_acc:=cfg.Writers.StartId+2*id+2
72-
70+
from_acc:=rand.Intn(cfg.AccountsNum)//cfg.Writers.StartId + 2*id + 1
71+
to_acc:=rand.Intn(cfg.AccountsNum)//cfg.Writers.StartId + 2*id + 2
72+
7373
conn1:=conns[rand.Intn(len(conns))]
7474
conn2:=conns[rand.Intn(len(conns))]
75-
ifconn1==conn2 {
76-
continue
75+
forconn1==conn2 {
76+
conn1=conns[rand.Intn(len(conns))]
77+
conn2=conns[rand.Intn(len(conns))]
7778
}
7879

7980
exec(conn1,"begin transaction")

‎tests/run_perf.sh‎

100644100755
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
go run perf/*.go \
22
-C"dbname=postgres port=5432 sslmode=disable" \
33
-C"dbname=postgres port=5433 sslmode=disable" \
4-
-C"dbname=postgres port=5434 sslmode=disable" \
5-
-g -w 8 -r 1 -n 1000 -a 10000 -i
4+
-g -w 64 -r 1 -n 10000 -a 10000 -i
65

76
go run perf/*.go \
87
-C"dbname=postgres port=5432 sslmode=disable" \
98
-C"dbname=postgres port=5433 sslmode=disable" \
10-
-C"dbname=postgres port=5434 sslmode=disable" \
11-
-g -w 8 -r 1 -n 1000 -a 10000
9+
-g -w 64 -r 1 -n 10000 -a 10000

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp