File tree Expand file tree Collapse file tree 6 files changed +44
-5
lines changed Expand file tree Collapse file tree 6 files changed +44
-5
lines changed Original file line number Diff line number Diff line change 26
26
27
27
# good for both launch and termination
28
28
- import_tasks : tasks/clean_ec2_cache.yml
29
+ tags :
30
+ - clean_ec2_cache
29
31
30
32
- name : terminate all ec2 instances
31
33
ec2 :
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ shardman_version_tag=master
40
40
41
41
shardman_shardlord_connstring="host={{ shardlord_ip }} port={{ pg_port }} user={{ ansible_user }}"
42
42
43
+ fg_path="{{ ansible_env.HOME }}/FlameGraph"
44
+
43
45
test_id=""
44
46
logs=logs
45
47
Original file line number Diff line number Diff line change 17
17
- set_fact : test_id="{{ test_id }}-{{ now.stdout }}"
18
18
when : tmstmp
19
19
20
- - hosts : workers
20
+ # run pgbench on active_workers workers, by default all of them.
21
+ - hosts : workers[0:{{ (active_workers | int ) - 1 }}]
22
+ environment :
23
+ PATH : " {{ pg_dst }}/bin:{{ fg_path }}:{{ ansible_env.PATH }}"
21
24
vars :
25
+ active_workers : " {{ groups['workers'] | length }}"
22
26
pgbench_opts : " "
23
- environment :
24
- PATH : " {{ pg_dst }}/bin:{{ ansible_env.PATH }}"
25
27
26
28
tasks :
27
29
- name : vacuum
Original file line number Diff line number Diff line change 147
147
when : tags_not_specified is not defined
148
148
tags : ars
149
149
150
+ - name : Install packages for Arseny's emacs
151
+ command : emacs emacs -batch --eval '(message "Hi!")' -u {{ ansible_user}}
152
+ when : tags_not_specified is not defined
153
+ tags : ars
154
+
150
155
- name : set PATH in .bashrc
151
156
lineinfile : dest=~/.bashrc line="export PATH={{ pg_dst }}/bin:$PATH"
152
157
tags :
167
172
tags :
168
173
- allow_ptrace
169
174
175
+ - name : install perf for xenial
176
+ apt : name=linux-tools-4.4.0-1022-aws state=installed
177
+ when : ansible_os_family == "Debian"
178
+ become : yes
179
+ tags :
180
+ - perf
181
+
182
+ - name : allow perfing
183
+ shell : echo 0 | sudo tee /proc/sys/kernel/kptr_restrict
184
+ become : yes
185
+ tags : perf
186
+
187
+ - name : download flamegraph
188
+ git : repo=https://github.com/brendangregg/FlameGraph.git
189
+ dest="{{ fg_path }}"
190
+ version=master
191
+ depth=1
192
+ accept_hostkey=True
193
+ tags : perf
194
+
195
+ - name : set PATH in .bashrc
196
+ lineinfile : dest=~/.bashrc line="export PATH={{ fg_path }}:$PATH"
197
+ tags :
198
+ - perf
199
+
170
200
- import_playbook : init.yml
171
201
tags :
172
202
- init
Original file line number Diff line number Diff line change @@ -60,7 +60,9 @@ Create, fill and shard pgbench tables:
60
60
ansible-playbook -i inventory_ec2/ pgbench_prepare.yml -e "scale=10 nparts=3 repfactor=0"
61
61
Run pgbench test:
62
62
ansible-playbook -i inventory_ec2/ pgbench_run.yml -e 'tmstmp=false tname=t pgbench_opts="-c 1 -T 5"'
63
- Run pgbench on single worker (to estimate shardman overhead):
63
+ Run pgbench only on node:
64
+ ansible-playbook -i inventory_ec2/ pgbench_run.yml -e 'tmstmp=false tname=t pgbench_opts="-c 1 -T 2" active_workers=1'
65
+ Run pgbench on single node without shardman (to estimate shardman overhead):
64
66
ansible-playbook -i inventory_ec2/ pgbench_single.yml -e "scale=10 tmstmp=false tname=test t=false clients=8 seconds=15"
65
67
66
68
Gather logs to ./logs:
Original file line number Diff line number Diff line change 1
1
---
2
2
3
3
- name : clean ec2 cache
4
- shell : " rm -rf ~/.ansible/tmp/ansible-ec2-*"
4
+ local_action : shell rm -rf ~/.ansible/tmp/ansible-ec2-*
5
+ run_once : True
You can’t perform that action at this time.
0 commit comments