-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuttcp.yml
43 lines (38 loc) · 1.29 KB
/
nuttcp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
- hosts: all
gather_facts: False
become: True
vars:
duration: 300s
length: 8972
prefix_str: nuttcp
flow_bw: 1G
wait: 10
tasks:
- name: Find nuttcp server processes
shell: "ps -aux | egrep 'nuttcp -S' | grep -v grep | awk {'print $2'}"
register: has_nuttcp
changed_when: has_nuttcp.rc != 0
- debug: msg="{{ has_nuttcp }}"
- name: Start over all nuttcp servers
shell: "nohup nuttcp -S -P {{ item.ctrl_port }} -p {{ item.data_port }} > /dev/null 2>&1 &"
async: 86400
poll: 0
with_items:
- "{{ nuttcp_server }}"
when: has_nuttcp.stdout == ''
- name: Start nuttcp data transfers in parallel for {{ duration }}
shell: "nohup nuttcp -xc {{ item.cpu }} -P {{ item.ctrl_port }} -p {{ item.data_port }} -l{{ length }} -T{{ duration }} -u -w4m -R{{ flow_bw }} -i 1 {{ item.dst_ip }} > /tmp/{{ prefix_str }}_{{ item.dst_ip }}.log 2>&1 &"
async: 86400
poll: 0
with_items:
- "{{ nuttcp_flows }}"
- name: Wait for {{ wait }} seconds before checking the transfers output
wait_for:
timeout: "{{ wait }}"
- name: Verifying data transfers output
shell: "nohup tail /tmp/{{ prefix_str }}_{{ item.dst_ip }}.log"
register: transfers_res
with_items:
- "{{ nuttcp_flows }}"
- debug: var=transfers_res