Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update load values #56

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions ansible/group_vars/all.yaml
Expand Up @@ -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
12 changes: 6 additions & 6 deletions ansible/loader-run.yaml
Expand Up @@ -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
24 changes: 12 additions & 12 deletions 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
6 changes: 3 additions & 3 deletions experiment.mk
Expand Up @@ -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