Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3445f4d

Browse files
committed
Rebalance flag, fixed set_path, other little things.
1 parent be137ba commit 3445f4d

File tree

6 files changed

+29
-25
lines changed

6 files changed

+29
-25
lines changed

devops/pgbench_prepare.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
scale: 10
2626
nparts: 10
2727
repfactor: 0
28+
rebalance: true
2829
environment:
2930
PATH: "{{ pg_dst }}/bin:{{ ansible_env.PATH }}"
3031

@@ -59,9 +60,9 @@
5960
- name: create_hash_partitions, nparts {{ nparts }}
6061
command: >
6162
psql -p {{ pg_port }} -c "
62-
select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_accounts', 'aid', {{ nparts }});
63-
select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_tellers', 'tid', {{ nparts }});
64-
select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_branches', 'bid', {{ nparts }});
63+
select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_accounts', 'aid', {{ nparts }}, {{ rebalance }});
64+
select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_tellers', 'tid', {{ nparts }}, {{ rebalance }});
65+
select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_branches', 'bid', {{ nparts }}, {{ rebalance }});
6566
"
6667
tags:
6768
- create_hash_partitions

devops/pgbench_run.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,4 @@
9898
register: tps
9999
run_once: true
100100

101-
- debug: msg="{{ tps.stdout }}. test_id {{ test_id }} "
101+
- debug: msg="{{ tps.stdout_lines }}. test_id {{ test_id }} "

devops/pgbench_single.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,9 @@
2626
command: >
2727
pgbench -p {{ pg_port }} -s {{ scale }} -i
2828
29-
- name: run pgbench -T {{ seconds }}
29+
- name: run pgbench --report-latencies {{ pgbench_opts }}
3030
shell: >
31-
pgbench -p {{ pg_port }} --report-latencies
32-
-c {{ clients }} -T {{ seconds }} 2>&1 > "pgbench.out"
33-
when: not ( t | bool )
34-
35-
- name: run pgbench -t {{ xacts }}
36-
shell: >
37-
pgbench -p {{ pg_port }} --report-latencies
38-
-c {{ clients }} -t {{ xacts }} 2>&1 > "pgbench.out"
39-
when: t | bool
31+
pgbench -p {{ pg_port }} --report-latencies {{ pgbench_opts }} 2>&1 > "pgbench.out"
4032
4133
- name: fetch pgbench exec time
4234
fetch:
@@ -52,4 +44,4 @@
5244
register: tps
5345
run_once: true
5446

55-
- debug: msg={{ tps.stdout }}
47+
- debug: msg={{ tps.stdout_lines }}

devops/postgresql.conf.common.example

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,35 @@ log_timezone = 'Europe/Moscow'
33

44
listen_addresses = '*'
55

6-
log_min_messages = LOG
6+
log_min_messages = NOTICE
77
client_min_messages = NOTICE
88
log_replication_commands = on
99

10-
max_replication_slots = 300
11-
max_wal_senders = 300
12-
max_logical_replication_workers = 300
13-
max_worker_processes = 300
10+
# log_statement = 'all'
11+
# logging_collector = on
12+
# log_directory= '/tmp/pg/data_5432'
13+
# log_filename = 'pg.log'
14+
15+
max_replication_slots = 1000
16+
max_wal_senders = 1000
17+
max_logical_replication_workers = 1000
18+
max_worker_processes = 1000
1419

1520
# performance-related settings
16-
shared_buffers = {{ (ansible_memtotal_mb * 0.5) | int }}MB
21+
# shared_buffers = {{ (ansible_memtotal_mb * 0.6) | int }}MB
22+
shared_buffers = {{ (ansible_memtotal_mb * 0.6) | int }}MB
1723
effective_cache_size = 4GB
1824
work_mem = 32MB
19-
max_connections = 1000
25+
max_connections = 3000
2026
# don't do checkpoints
2127
checkpoint_timeout = 60min
2228
max_wal_size = 100GB
23-
fsync = off
29+
fsync = on
2430
autovacuum = off
31+
# synchronous_commit = on
32+
synchronous_commit = local
2533

2634
shardman.shardlord_dbname = ubuntu
2735
shardman.poll_interval = 500 # long operations poll frequency in milliseconds
36+
37+
shardman.sync_replicas = off

devops/provision.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
lineinfile: dest=~/.bashrc line="export PATH={{ pg_dst }}/bin:$PATH"
157157
tags:
158158
- set_path
159+
- ars
159160

160161
- name: allow ptrace for non-root users
161162
lineinfile: dest=/etc/sysctl.d/10-ptrace.conf

devops/readme.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ Read nodes table on workers:
5757
nodes': ansible-playbook -i inventory_ec2/ psql.yml --limit 'workers' -e "cmd='\'table shardman.nodes\''"
5858

5959
Create, fill and shard pgbench tables:
60-
ansible-playbook -i inventory_ec2/ pgbench_prepare.yml -e "scale=10 nparts=3 repfactor=0"
60+
ansible-playbook -i inventory_ec2/ pgbench_prepare.yml -e "scale=10 nparts=3 repfactor=0 rebalance=true"
6161
Run pgbench test:
6262
ansible-playbook -i inventory_ec2/ pgbench_run.yml -e 'tmstmp=false tname=t pgbench_opts="-c 1 -T 5"'
6363
Run pgbench only on node:
6464
ansible-playbook -i inventory_ec2/ pgbench_run.yml -e 'tmstmp=false tname=t pgbench_opts="-c 1 -T 2" active_workers=1'
6565
Run pgbench on single node without shardman (to estimate shardman overhead):
66-
ansible-playbook -i inventory_ec2/ pgbench_single.yml -e "scale=10 tmstmp=false tname=test t=false clients=8 seconds=15"
66+
ansible-playbook -i inventory_ec2/ pgbench_single.yml -e 'scale=10 tmstmp=false tname=test t=false pgbench_opts="-c 1 -T 5"'
6767

6868
Gather logs to ./logs:
6969
ansible-playbook -i inventory_ec2/ logs.yml

0 commit comments

Comments
 (0)