From 36e7c916b648e1a316a088c95bd9cf1810d5ac22 Mon Sep 17 00:00:00 2001 From: hvanz Date: Tue, 19 Mar 2024 09:51:02 +0100 Subject: [PATCH] Update load values --- Makefile | 8 ++++---- ansible/group_vars/all.yaml | 7 ------- ansible/loader-run.yaml | 12 ++++++------ ansible/scripts/200-node-loadscript.sh | 24 ++++++++++++------------ experiment.mk | 6 +++--- 5 files changed, 25 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index dd4ef49..748c02d 100644 --- a/Makefile +++ b/Makefile @@ -72,10 +72,10 @@ stop-network: runload: ansible-playbook ./ansible/loader-run.yaml \ -e endpoints=`./ansible/scripts/get-endpoints.sh` \ - -e load.connections=$(LOAD_CONNECTIONS) \ - -e load.time_seconds=$(LOAD_TOTAL_TIME) \ - -e load.tx_per_second=$(LOAD_TX_RATE) \ - -e load.iterations=$(ITERATIONS) + -e connections=$(LOAD_CONNECTIONS) \ + -e time_seconds=$(LOAD_TOTAL_TIME) \ + -e tx_per_second=$(LOAD_TX_RATE) \ + -e iterations=$(ITERATIONS) .PHONY: restart restart: loadrunners-init diff --git a/ansible/group_vars/all.yaml b/ansible/group_vars/all.yaml index 8f65484..86a60db 100644 --- a/ansible/group_vars/all.yaml +++ b/ansible/group_vars/all.yaml @@ -4,10 +4,3 @@ cmt_home: /root/.testapp/ ansible_host_key_checking: false go_modules_token: "" - -load: - connections: 2 - time_seconds: 91 - tx_per_second: 200 - size_bytes: 1024 - iterations: 5 diff --git a/ansible/loader-run.yaml b/ansible/loader-run.yaml index 971f9db..1a481de 100644 --- a/ansible/loader-run.yaml +++ b/ansible/loader-run.yaml @@ -8,17 +8,17 @@ tasks: - debug: msg: - connections: "{{ load.connections }}" - tx_per_second: "{{ load.tx_per_second }}" - size_bytes: "{{ load.size_bytes }}" - time_seconds: "{{ load.time_seconds }}" + connections: "{{ connections }}" + tx_per_second: "{{ tx_per_second }}" + size_bytes: "{{ size_bytes }}" + time_seconds: "{{ time_seconds }}" endpoints: "{{ endpoints }}" - name: install load tool shell: "cd cometbft/test/loadtime/cmd/load/ && /usr/lib/go-1.21/bin/go install" - name: run the load tool - shell: "/root/go/bin/load -c {{ load.connections }} -T {{ load.time_seconds }} -r {{ load.tx_per_second }} -s {{ load.size_bytes }} --broadcast-tx-method sync --endpoints {{ endpoints }}" - loop: "{{ range(0, load.iterations| int, 1)| list }}" + shell: "/root/go/bin/load -c {{ connections }} -T {{ time_seconds }} -r {{ tx_per_second }} -s {{ size_bytes }} --broadcast-tx-method sync --endpoints {{ endpoints }}" + loop: "{{ range(0, iterations| int, 1)| list }}" loop_control: pause: 300 diff --git a/ansible/scripts/200-node-loadscript.sh b/ansible/scripts/200-node-loadscript.sh index aefcaec..b5c6fd1 100755 --- a/ansible/scripts/200-node-loadscript.sh +++ b/ansible/scripts/200-node-loadscript.sh @@ -1,27 +1,27 @@ #!/bin/bash +## Set of test instances for finding the saturation point of the network. + set -euo pipefail -CONNS=(1 2 4) -RATES=(200 400 800 1600) -ADDR=127.0.0.1 # Fill in with the IP address of a node to target +RATES=(100 200 300 400 500 600 700 800 900 1000) +ADDR=${1:-"127.0.0.1"} # Fill in with the IP address of a node to target mempoolfull() { - if [ `curl -s "http://$ADDR:26657/num_unconfirmed_txs" | jq .result.n_txs | tr -d '"'` ]; then + if [ `curl -s "http://$ADDR:26657/v1/num_unconfirmed_txs" | jq .result.n_txs | tr -d '"'` ]; then return 1 fi return 0 } -for conn in ${CONNS[@]}; do - for rate in ${RATES[@]}; do - echo "Conns: $conn, Rate: $rate" - /root/go/bin/load -c $conn -T 90 -r $rate -s 1024 --broadcast-tx-method sync --endpoints "ws://$ADDR:26657/v1/websocket" - while mempoolfull; do - sleep 5; - done - sleep `expr 120 + $rate / 60`; +for rate in ${RATES[@]}; do + echo "Rate: $rate tx/s" + /root/go/bin/load -c 1 -T 181 -r $rate -s 1024 --broadcast-tx-method sync --endpoints "ws://$ADDR:26657/v1/websocket" + while mempoolfull; do + sleep 5; done + sleep `expr 120 + $rate / 60`; done + echo "Experiments Complete" echo diff --git a/experiment.mk b/experiment.mk index 290ab69..91a97a0 100644 --- a/experiment.mk +++ b/experiment.mk @@ -20,7 +20,7 @@ VERSION2_WEIGHT ?= 0 EPHEMERAL_SIZE ?= 0 -LOAD_CONNECTIONS ?= 2 -LOAD_TX_RATE ?= 200 -LOAD_TOTAL_TIME ?= 91 +LOAD_CONNECTIONS ?= 1 +LOAD_TX_RATE ?= 400 +LOAD_TOTAL_TIME ?= 181 ITERATIONS ?= 5