Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 0 additions & 87 deletions scripts/Lite_protocol_scripts/store/Store_multinodes.sh

This file was deleted.

151 changes: 151 additions & 0 deletions scripts/Lite_protocol_scripts/store/nodes_15_scenario2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
#!/bin/bash
set -e
if ! typeset -f wn >/dev/null 2>&1; then
wn() { docker compose "$@"; }
fi
# - waku-simulator: 15-node network, 1 service, 1 edge
# - Service node limited by env below (CPU cores 0-3; memory 512 MiB)
# - Phases driven by LPT; Sonda runs throughout to exercise Store
# - This variant stresses CPU more and uses 120s observe windows

echo " Running test..."

# -------------------- Bring up simulator ------------------------
cd ./waku-simulator

export NWAKU_IMAGE=wakuorg/nwaku:latest
export NUM_NWAKU_NODES=15
export RLN_ENABLED=false

export SERVICENODE_CPU_CORES="0-3"
export SERVICENODE_MEM_LIMIT=512m

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on the test, but in this particular case, for pushing large messages (above 100k) in every 100ms... 500MB ram can be low for a service node.
I recommend at least 2GB... for such case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

export POSTGRES_CPU_CORES="0-3"
export POSTGRES_MEM_LIMIT=2g
export POSTGRES_SHM=1g

docker compose up -d

# Wait until service node is running
while true; do
sid="$(docker compose ps -q servicenode || true)"
if [[ -n "$sid" ]]; then
state="$(docker inspect --format '{{.State.Status}}' "$sid" 2>/dev/null || true)"
[[ "$state" == "running" ]] && break
fi
sleep 1
done

cd ../lpt

# -------------------- LPT common knobs (same exports) -------------------------
export LPT_IMAGE=harbor.status.im/wakuorg/liteprotocoltester:latest
export START_PUBLISHING_AFTER=15
export NUM_MESSAGES=0
export MESSAGE_INTERVAL_MILLIS=100

export MIN_MESSAGE_SIZE=120Kb
export MAX_MESSAGE_SIZE=145Kb

export LIGHTPUSH_SERVICE_PEER=/ip4/10.2.0.101/tcp/60001/p2p/16Uiu2HAkyte8uj451tGkbww4Mjcg6DRnmAHxNeWyF4zp23RbpG3n
export FILTER_SERVICE_PEER=/ip4/10.2.0.101/tcp/60001/p2p/16Uiu2HAkyte8uj451tGkbww4Mjcg6DRnmAHxNeWyF4zp23RbpG3n

export PUBSUB=/waku/2/rs/66/0
export CONTENT_TOPIC=/tester/2/light-pubsub-test/wakusim
export CLUSTER_ID=66

# wait time before starting traffic
sleep 60


# -------------------- Sonda (Store monitor) -----------------------------------
cd ../sonda

docker build -t local-perf-sonda -f ./Dockerfile.sonda .

# perf-test.env
cat <<EOF > perf-test.env
RELAY_NODE_REST_ADDRESS=http://127.0.0.1:8645
STORE_NODE_REST_ADDRESS=http://127.0.0.1:8644
QUERY_DELAY=0.5
STORE_NODES=/ip4/10.2.0.101/tcp/60001/p2p/16Uiu2HAkyte8uj451tGkbww4Mjcg6DRnmAHxNeWyF4zp23RbpG3n
CLUSTER_ID=66
SHARD=0
EOF

sleep 5

docker rm -f sonda >/dev/null 2>&1 || true
docker run --env-file ./perf-test.env -l sonda -d --network host local-perf-sonda

cd ../lpt

# -------------------- Phase 1: 6 pub / 6 recv --------------------------------
export NUM_PUBLISHER_NODES=6
export NUM_RECEIVER_NODES=6
docker compose down -v >/dev/null 2>&1 || true
docker compose up -d

current_time=$(date +"%Y-%m-%d %H:%M:%S")
echo "[test] LPT is running with 6 publishers and 6 receivers + sonda from now: $current_time"

sleep 120

# -------------------- Phase 2: 3 pub / 12 recv -------------------------------
docker compose down -v
export NUM_PUBLISHER_NODES=3
export NUM_RECEIVER_NODES=12
docker compose up -d

current_time=$(date +"%Y-%m-%d %H:%M:%S")
echo "[test] LPT is running with 3 publishers and 12 receivers from now: $current_time"

sleep 120

# -------------------- Phase 3: 12 pub / 3 recv -------------------------------
docker compose down -v
export NUM_PUBLISHER_NODES=12
export NUM_RECEIVER_NODES=3
docker compose up -d

current_time=$(date +"%Y-%m-%d %H:%M:%S")
echo "[test] LPT is running with 12 publishers and 3 receivers from now: $current_time"

sleep 120

# -------------------- Phase 4: receivers down; keep publisher + sonda --------
docker compose down -v
export NUM_PUBLISHER_NODES=12
export NUM_RECEIVER_NODES=0
docker compose up -d

current_time=$(date +"%Y-%m-%d %H:%M:%S")
echo "[test] LPT receivers are down; sonda and lightpush publisher running from now: $current_time"

sleep 120

# -------------------- Phase 5: LPT down; only sonda --------------------------
docker compose down -v

current_time=$(date +"%Y-%m-%d %H:%M:%S")
echo "[test] LPT down; only sonda is working from now: $current_time"

sleep 120

# -------------------- Phase 6: final high-load burst -----------------

export NUM_PUBLISHER_NODES=12
export NUM_RECEIVER_NODES=12
docker compose up -d

current_time=$(date +"%Y-%m-%d %H:%M:%S")
echo "[test] Final burst: LPT running with 12 publishers and 12 receivers from now: $current_time"

sleep 120

cd ..

current_time=$(date +"%Y-%m-%d %H:%M:%S")
echo "[test] Test finished at $current_time"

# finish
# exec ./stop_test.sh
140 changes: 140 additions & 0 deletions scripts/Lite_protocol_scripts/store/nodes_15_service_1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
#!/bin/bash
set -e

# - waku-simulator: 15-node network, 1 service, 1 edge
# - Service node limited by env below (CPU cores 0-3; memory 512 MiB)
# - Phases driven by LPT; Sonda runs throughout to exercise Store
# - This variant stresses CPU more and uses 120s observe windows

echo "Running test..."

# -------------------- Bring up simulator ------------------------
cd ./waku-simulator

export NWAKU_IMAGE=wakuorg/nwaku:latest
export NUM_NWAKU_NODES=15
export RLN_ENABLED=false

export SERVICENODE_CPU_CORES="0-3"
export SERVICENODE_MEM_LIMIT=512m
export POSTGRES_CPU_CORES="0-3"
export POSTGRES_MEM_LIMIT=2g
export POSTGRES_SHM=1g

docker compose up -d

# Wait until service node is running
while true; do
sid="$(docker compose ps -q servicenode || true)"
if [[ -n "$sid" ]]; then
state="$(docker inspect --format '{{.State.Status}}' "$sid" 2>/dev/null || true)"
[[ "$state" == "running" ]] && break
fi
sleep 1
done

cd ../lpt

# -------------------- LPT common knobs -------------------------
export LPT_IMAGE=harbor.status.im/wakuorg/liteprotocoltester:latest
export START_PUBLISHING_AFTER=15
export NUM_MESSAGES=0
export MESSAGE_INTERVAL_MILLIS=100

export MIN_MESSAGE_SIZE=120Kb
export MAX_MESSAGE_SIZE=145Kb

export LIGHTPUSH_SERVICE_PEER=/ip4/10.2.0.101/tcp/60001/p2p/16Uiu2HAkyte8uj451tGkbww4Mjcg6DRnmAHxNeWyF4zp23RbpG3n
export FILTER_SERVICE_PEER=/ip4/10.2.0.101/tcp/60001/p2p/16Uiu2HAkyte8uj451tGkbww4Mjcg6DRnmAHxNeWyF4zp23RbpG3n

export PUBSUB=/waku/2/rs/66/0
export CONTENT_TOPIC=/tester/2/light-pubsub-test/wakusim
export CLUSTER_ID=66

# wait time before starting traffic
sleep 60

# Start LPT for Phase 1 will happen after Sonda is up

# -------------------- Sonda (Store monitor) -----------------------------------
cd ../sonda

docker build -t local-perf-sonda -f ./Dockerfile.sonda .

# perf-test.env
cat <<EOF > perf-test.env
RELAY_NODE_REST_ADDRESS=http://127.0.0.1:8645
STORE_NODE_REST_ADDRESS=http://127.0.0.1:8644
QUERY_DELAY=0.5
STORE_NODES=/ip4/10.2.0.101/tcp/60001/p2p/16Uiu2HAkyte8uj451tGkbww4Mjcg6DRnmAHxNeWyF4zp23RbpG3n
CLUSTER_ID=66
SHARD=0
EOF

sleep 5

docker rm -f sonda >/dev/null 2>&1 || true
docker run --env-file ./perf-test.env -l sonda -d --network host local-perf-sonda

cd ../lpt

# -------------------- Phase 1: 6 pub / 6 recv --------------------------------
export NUM_PUBLISHER_NODES=6
export NUM_RECEIVER_NODES=6
docker compose down -v >/dev/null 2>&1 || true
docker compose up -d

current_time=$(date +"%Y-%m-%d %H:%M:%S")
echo "LPT is running with 6 publishers and 6 receivers + sonda from now: $current_time"

sleep 120

# -------------------- Phase 2: 3 pub / 12 recv -------------------------------
docker compose down -v
export NUM_PUBLISHER_NODES=3
export NUM_RECEIVER_NODES=12
docker compose up -d

current_time=$(date +"%Y-%m-%d %H:%M:%S")
echo "LPT is running with 3 publishers and 12 receivers from now: $current_time"

sleep 120

# -------------------- Phase 3: 12 pub / 3 recv -------------------------------
docker compose down -v
export NUM_PUBLISHER_NODES=12
export NUM_RECEIVER_NODES=3
docker compose up -d

current_time=$(date +"%Y-%m-%d %H:%M:%S")
echo "LPT is running with 12 publishers and 3 receivers from now: $current_time"

sleep 120

# -------------------- Phase 4: receivers down; keep publisher + sonda --------
docker compose down -v
export NUM_PUBLISHER_NODES=12
export NUM_RECEIVER_NODES=0
docker compose up -d

current_time=$(date +"%Y-%m-%d %H:%M:%S")
echo "LPT receivers are down; sonda and lightpush publisher running from now: $current_time"

sleep 120

# -------------------- Phase 5: LPT down; only sonda --------------------------
docker compose down -v

current_time=$(date +"%Y-%m-%d %H:%M:%S")
echo "LPT down; only sonda is working from now: $current_time"

sleep 120

cd ..

current_time=$(date +"%Y-%m-%d %H:%M:%S")
echo "Test finished at $current_time"

# finish
# exec ./stop_test.sh
s
Loading