--- - name: Benchmark Client hosts: benchmark sudo: yes remote_user: ubuntu gather_facts: False vars: server_host: '172.31.21.207' hostname: ws-bench-client local_ips: ['172.31.19.119', '172.31.19.120', '172.31.17.121', '172.31.17.122'] # local_ips_str: '-l 172.31.19.119 -l 172.31.19.120 -l 172.31.17.121 -l 172.31.17.122' local_ips_str: '' steps: 10 step_size: 1000 sample_size: 100 concurrency: 8 payload_size: 200 prepare: False log_file: "./last_bench.log" tasks: - name: Prepare the machine tags: prepare block: - hostname: name: "{{ hostname }}" - lineinfile: path: /etc/hosts line: '127.0.0.1 {{ hostname }}' state: present - shell: ip addr add {{ item }}/20 dev eth0 with_items: "{{ local_ips }}" - name: Print Action Cable command debug: msg="bin/websocket-bench broadcast {{ local_ips_str }} --concurrent {{ concurrency }} --sample-size {{ sample_size }} --step-size {{ step_size }} --payload-padding {{ payload_size }} --total-steps {{ steps }} --origin http://0.0.0.0 ws://{{ server_host }}:3334/cable --server-type=actioncable" tags: action_cable - name: Action Cable benchmark become_user: deplo shell: bin/websocket-bench broadcast {{ local_ips_str }} --concurrent {{ concurrency }} --sample-size {{ sample_size }} --step-size {{ step_size }} --payload-padding {{ payload_size }} --total-steps {{ steps }} --origin http://0.0.0.0 ws://{{ server_host }}:3334/cable --server-type=actioncable register: bench tags: action_cable args: chdir: /webapps/anycable_bench ignore_errors: yes - name: Print base command debug: msg="bin/websocket-bench broadcast {{ local_ips_str }} --concurrent {{ concurrency }} --sample-size {{ sample_size }} --step-size {{ step_size }} --payload-padding {{ payload_size }} --total-steps {{ steps }} ws://{{ server_host }}:3334/cable" tags: base - name: Base benchmark become_user: deplo shell: bin/websocket-bench broadcast {{ local_ips_str }} --concurrent {{ concurrency }} --sample-size {{ sample_size }} --step-size {{ step_size }} --payload-padding {{ payload_size }} --total-steps {{ steps }} ws://{{ server_host }}:3334/cable register: bench tags: base args: chdir: /webapps/anycable_bench ignore_errors: yes - name: Benchmark results (stdout) debug: var=bench.stdout_lines tags: - action_cable - base - name: Benchmark results (stderr) debug: var=bench.stderr_lines tags: - action_cable - base