This directory supports two kinds of measurement:
- server/API acceptance via k6
- queue drain time via the queue benchmark tool
Use both. A fast summary.json only tells you the API accepted work quickly. The queue summary tells you how long workers took to finish it.
From the repo root:
python3 tests/loadtest/tools/dashboard.pyThat starts the dashboard server, opens your browser, and scans tests/loadtest/ for:
summary*.jsonqueue-summary*.jsonrun*.ndjson
If you do not want it to open a browser automatically:
python3 tests/loadtest/tools/dashboard.py --no-openOpen:
http://127.0.0.1:8765/dashboard/
These are the main flow tests to compare:
hot-to-cold-no-shard- one hot source sends to many cold destinations
cold-to-hot-no-shard- many cold sources send to one hot destination
hot-to-cold-shard- same as above, but the hot source is split into source buckets first
cold-to-hot-shard- same as above, but the hot destination is split into destination buckets first
tests/loadtest/script.js now has explicit scenarios for:
hot_sourcehot_destination
And supports optional sharding with:
SOURCE_BUCKETSDESTINATION_BUCKETS
Use the helper script from the repo root:
bash tests/loadtest/run_case.sh hot-to-cold-no-shardThat will:
- start the queue benchmark
- run the k6 load test
- wait for the queue benchmark to finish
- write three files into
tests/loadtest/
The output files are:
summary-<case>.jsonrun-<case>.ndjsonqueue-summary-<case>.json
Examples:
bash tests/loadtest/run_case.sh hot-to-cold-no-shard
bash tests/loadtest/run_case.sh cold-to-hot-no-shard
bash tests/loadtest/run_case.sh hot-to-cold-shard
bash tests/loadtest/run_case.sh cold-to-hot-shardIf the hot queue is enabled and you want the queue benchmark to include it:
bash tests/loadtest/run_case.sh hot-to-cold-no-shard hotThat makes the queue benchmark watch both:
new:transaction_*hot_*
If you want to run the tools manually instead of using run_case.sh, use two terminals.
Terminal 1, start the queue benchmark:
go run ./tests/loadtest/tools/queue_benchmark.go \
-redis-dsn "$BLNK_REDIS_DNS" \
-queue-prefixes "new:transaction_,hot_" \
-wait \
-out tests/loadtest/queue-summary.jsonTerminal 2, run k6:
k6 run \
--out json=tests/loadtest/run.ndjson \
-e SUMMARY_OUT=tests/loadtest/summary.json \
-e URL='http://localhost:5001/transactions' \
-e SCENARIO='hot_source' \
-e DURATION='30s' \
-e RATE='300' \
-e VUS='200' \
-e MAX_VUS='800' \
-e SOURCE_BUCKETS='1' \
tests/loadtest/script.jsFor cold-to-hot:
k6 run \
--out json=tests/loadtest/run.ndjson \
-e SUMMARY_OUT=tests/loadtest/summary.json \
-e URL='http://localhost:5001/transactions' \
-e SCENARIO='hot_destination' \
-e DURATION='30s' \
-e RATE='300' \
-e VUS='200' \
-e MAX_VUS='800' \
-e DESTINATION_BUCKETS='1' \
tests/loadtest/script.jsTo rerun the same test with sharding:
- for
hot_source, raiseSOURCE_BUCKETS - for
hot_destination, raiseDESTINATION_BUCKETS
Example:
k6 run \
--out json=tests/loadtest/run.ndjson \
-e SUMMARY_OUT=tests/loadtest/summary.json \
-e URL='http://localhost:5001/transactions' \
-e SCENARIO='hot_source' \
-e DURATION='30s' \
-e RATE='300' \
-e VUS='200' \
-e MAX_VUS='800' \
-e SOURCE_BUCKETS='8' \
tests/loadtest/script.jsUse this sequence and keep all generated files:
- run
hot-to-cold-no-shard - run
cold-to-hot-no-shard - review queue drain time and keep the reports
- shard and rerun the same two cases
- compare the new reports against the no-shard runs
- if you want to test queue optimizations on top, turn on worker concurrency, coalescing, or hot lane and rerun the sharded cases
For each case, inspect both:
- server summary
summary-<case>.json
- queue summary
queue-summary-<case>.json
Read them like this:
summary- how fast the API accepted the transactions
queue-summary- how fast the workers drained the queued work
The most useful comparison fields are:
- throughput
- p95 latency
- duration
- total processed
If the server numbers are good but queue duration is still high, the bottleneck is in worker drain, not API acceptance.