tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Outputs CSV. We add some stats for load times in developer mode, so we can
easily read them out.
peer_read_all_sec doesn't work, since we seem to reject about half the
updates for having bad signatures. It's also very slow...
routing fails, for unknown reasons, so that failure is ignored in routing_sec.
Results from 5 runs, min-max(mean +/- stddev):
store_load_msec,vsz_kb,store_rewrite_sec,listnodes_sec,listchannels_sec,routing_sec,peer_write_all_sec
39275-44779(40466.8+/-2.2e+03),2899248,41.010000-44.970000(41.972+/-1.5),2.280000-2.350000(2.304+/-0.025),49.770000-63.390000(59.178+/-5),33.310000-34.260000(33.62+/-0.35),42.100000-44.080000(43.082+/-0.67)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-2.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Suggested-by: @niftynei
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-1.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
MCP filename change.
Header from folded patch 'tools-bench-gossipd.sh__dont_print_csv_by_default.patch':
tools/bench-gossipd.sh: don't print CSV by default.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Make shellcheck happy.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-08 01:52:54 +02:00
|
|
|
#! /bin/sh
|
|
|
|
# Needs bitcoind -regtest running.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
DIR=""
|
|
|
|
TARGETS=""
|
2024-01-31 05:25:33 +01:00
|
|
|
DEFAULT_TARGETS=" store_load_msec vsz_kb listnodes_sec listchannels_sec routing_sec peer_write_all_sec peer_read_all_sec "
|
tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Outputs CSV. We add some stats for load times in developer mode, so we can
easily read them out.
peer_read_all_sec doesn't work, since we seem to reject about half the
updates for having bad signatures. It's also very slow...
routing fails, for unknown reasons, so that failure is ignored in routing_sec.
Results from 5 runs, min-max(mean +/- stddev):
store_load_msec,vsz_kb,store_rewrite_sec,listnodes_sec,listchannels_sec,routing_sec,peer_write_all_sec
39275-44779(40466.8+/-2.2e+03),2899248,41.010000-44.970000(41.972+/-1.5),2.280000-2.350000(2.304+/-0.025),49.770000-63.390000(59.178+/-5),33.310000-34.260000(33.62+/-0.35),42.100000-44.080000(43.082+/-0.67)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-2.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Suggested-by: @niftynei
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-1.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
MCP filename change.
Header from folded patch 'tools-bench-gossipd.sh__dont_print_csv_by_default.patch':
tools/bench-gossipd.sh: don't print CSV by default.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Make shellcheck happy.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-08 01:52:54 +02:00
|
|
|
MCP_DIR=../million-channels-project/data/1M/gossip/
|
|
|
|
CSV=false
|
|
|
|
|
|
|
|
wait_for_start()
|
|
|
|
{
|
|
|
|
i=0
|
|
|
|
ID=""
|
|
|
|
while [ -z "$ID" ]; do
|
|
|
|
ID="$($LCLI1 -H getinfo 2>/dev/null | grep '^id=' | cut -d= -f2)"
|
|
|
|
sleep 1
|
|
|
|
i=$((i + 1))
|
2019-05-04 07:53:12 +02:00
|
|
|
# If it has to upgrade the gossip store, that can take a while!
|
|
|
|
if [ $i = 120 ]; then
|
tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Outputs CSV. We add some stats for load times in developer mode, so we can
easily read them out.
peer_read_all_sec doesn't work, since we seem to reject about half the
updates for having bad signatures. It's also very slow...
routing fails, for unknown reasons, so that failure is ignored in routing_sec.
Results from 5 runs, min-max(mean +/- stddev):
store_load_msec,vsz_kb,store_rewrite_sec,listnodes_sec,listchannels_sec,routing_sec,peer_write_all_sec
39275-44779(40466.8+/-2.2e+03),2899248,41.010000-44.970000(41.972+/-1.5),2.280000-2.350000(2.304+/-0.025),49.770000-63.390000(59.178+/-5),33.310000-34.260000(33.62+/-0.35),42.100000-44.080000(43.082+/-0.67)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-2.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Suggested-by: @niftynei
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-1.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
MCP filename change.
Header from folded patch 'tools-bench-gossipd.sh__dont_print_csv_by_default.patch':
tools/bench-gossipd.sh: don't print CSV by default.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Make shellcheck happy.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-08 01:52:54 +02:00
|
|
|
echo "lightningd didn't start?" >&2
|
|
|
|
cat "$DIR"/log
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
2019-04-18 08:35:09 +02:00
|
|
|
# Wait for it to catch up with bitcoind.
|
2019-04-18 08:36:09 +02:00
|
|
|
while [ "$($LCLI1 -H getinfo | grep '^blockheight=' | cut -d= -f2)" != "$(bitcoin-cli -regtest getblockcount)" ]; do sleep 1; done
|
tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Outputs CSV. We add some stats for load times in developer mode, so we can
easily read them out.
peer_read_all_sec doesn't work, since we seem to reject about half the
updates for having bad signatures. It's also very slow...
routing fails, for unknown reasons, so that failure is ignored in routing_sec.
Results from 5 runs, min-max(mean +/- stddev):
store_load_msec,vsz_kb,store_rewrite_sec,listnodes_sec,listchannels_sec,routing_sec,peer_write_all_sec
39275-44779(40466.8+/-2.2e+03),2899248,41.010000-44.970000(41.972+/-1.5),2.280000-2.350000(2.304+/-0.025),49.770000-63.390000(59.178+/-5),33.310000-34.260000(33.62+/-0.35),42.100000-44.080000(43.082+/-0.67)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-2.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Suggested-by: @niftynei
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-1.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
MCP filename change.
Header from folded patch 'tools-bench-gossipd.sh__dont_print_csv_by_default.patch':
tools/bench-gossipd.sh: don't print CSV by default.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Make shellcheck happy.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-08 01:52:54 +02:00
|
|
|
echo "$ID"
|
|
|
|
}
|
|
|
|
|
|
|
|
print_stat()
|
|
|
|
{
|
|
|
|
if $CSV; then
|
|
|
|
sed -e 's/^ *//' -e 's/ *$//' | tr \\012 ,
|
|
|
|
else
|
|
|
|
echo "$1": | tr -d \\n
|
|
|
|
sed -e 's/^ *//' -e 's/ *$//'
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
for arg; do
|
|
|
|
case "$arg" in
|
|
|
|
--dir=*)
|
|
|
|
DIR="${arg#*=}"
|
|
|
|
;;
|
|
|
|
--mcp-dir=*)
|
|
|
|
MCP_DIR="${arg#*=}"
|
|
|
|
;;
|
|
|
|
--csv)
|
|
|
|
CSV=true
|
|
|
|
;;
|
|
|
|
--help)
|
|
|
|
echo "Usage: tools/bench-gossipd.sh [--dir=<directory>] [--mcp-dir=<directory>] [--csv] [TARGETS]"
|
|
|
|
echo "Default targets:$DEFAULT_TARGETS"
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
-*)
|
|
|
|
echo "Unknown arg $arg" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
TARGETS="$TARGETS $arg"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
# Targets must be space-separated for ## trick.
|
|
|
|
if [ -z "$TARGETS" ]; then
|
|
|
|
TARGETS="$DEFAULT_TARGETS"
|
|
|
|
else
|
|
|
|
TARGETS="$TARGETS "
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! bitcoin-cli -regtest ping >/dev/null 2>&1; then
|
|
|
|
bitcoind -regtest > "$DIR"/bitcoind.log &
|
|
|
|
|
|
|
|
while ! bitcoin-cli -regtest ping >/dev/null 2>&1; do sleep 1; done
|
|
|
|
fi
|
|
|
|
|
2023-09-21 07:36:28 +02:00
|
|
|
LIGHTNINGD="./lightningd/lightningd --developer --network=regtest --dev-gossip-time=1550513768"
|
2019-04-08 11:58:44 +02:00
|
|
|
LCLI1="./cli/lightning-cli --lightning-dir=$DIR -R"
|
tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Outputs CSV. We add some stats for load times in developer mode, so we can
easily read them out.
peer_read_all_sec doesn't work, since we seem to reject about half the
updates for having bad signatures. It's also very slow...
routing fails, for unknown reasons, so that failure is ignored in routing_sec.
Results from 5 runs, min-max(mean +/- stddev):
store_load_msec,vsz_kb,store_rewrite_sec,listnodes_sec,listchannels_sec,routing_sec,peer_write_all_sec
39275-44779(40466.8+/-2.2e+03),2899248,41.010000-44.970000(41.972+/-1.5),2.280000-2.350000(2.304+/-0.025),49.770000-63.390000(59.178+/-5),33.310000-34.260000(33.62+/-0.35),42.100000-44.080000(43.082+/-0.67)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-2.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Suggested-by: @niftynei
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-1.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
MCP filename change.
Header from folded patch 'tools-bench-gossipd.sh__dont_print_csv_by_default.patch':
tools/bench-gossipd.sh: don't print CSV by default.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Make shellcheck happy.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-08 01:52:54 +02:00
|
|
|
|
|
|
|
if [ -z "$DIR" ]; then
|
|
|
|
trap 'rm -rf "$DIR"' 0
|
|
|
|
|
|
|
|
DIR="$(mktemp -d)"
|
2019-04-18 08:34:09 +02:00
|
|
|
./devtools/create-gossipstore --csv "$MCP_DIR"/scidSatoshis.csv -i "$MCP_DIR"/1M.gossip -o "$DIR"/gossip_store
|
tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Outputs CSV. We add some stats for load times in developer mode, so we can
easily read them out.
peer_read_all_sec doesn't work, since we seem to reject about half the
updates for having bad signatures. It's also very slow...
routing fails, for unknown reasons, so that failure is ignored in routing_sec.
Results from 5 runs, min-max(mean +/- stddev):
store_load_msec,vsz_kb,store_rewrite_sec,listnodes_sec,listchannels_sec,routing_sec,peer_write_all_sec
39275-44779(40466.8+/-2.2e+03),2899248,41.010000-44.970000(41.972+/-1.5),2.280000-2.350000(2.304+/-0.025),49.770000-63.390000(59.178+/-5),33.310000-34.260000(33.62+/-0.35),42.100000-44.080000(43.082+/-0.67)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-2.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Suggested-by: @niftynei
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-1.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
MCP filename change.
Header from folded patch 'tools-bench-gossipd.sh__dont_print_csv_by_default.patch':
tools/bench-gossipd.sh: don't print CSV by default.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Make shellcheck happy.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-08 01:52:54 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
if $CSV; then echo $TARGETS | tr ' ' ,; fi
|
|
|
|
|
|
|
|
# First, measure load time.
|
2019-05-04 07:53:12 +02:00
|
|
|
rm -f "$DIR"/peer
|
2019-05-16 21:56:17 +02:00
|
|
|
[ ! -f "$DIR"/log ] || mv "$DIR"/log "$DIR"/log.old.$$
|
|
|
|
$LIGHTNINGD --lightning-dir="$DIR" --log-file="$DIR"/log --log-level=debug --bind-addr="$DIR"/peer &
|
tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Outputs CSV. We add some stats for load times in developer mode, so we can
easily read them out.
peer_read_all_sec doesn't work, since we seem to reject about half the
updates for having bad signatures. It's also very slow...
routing fails, for unknown reasons, so that failure is ignored in routing_sec.
Results from 5 runs, min-max(mean +/- stddev):
store_load_msec,vsz_kb,store_rewrite_sec,listnodes_sec,listchannels_sec,routing_sec,peer_write_all_sec
39275-44779(40466.8+/-2.2e+03),2899248,41.010000-44.970000(41.972+/-1.5),2.280000-2.350000(2.304+/-0.025),49.770000-63.390000(59.178+/-5),33.310000-34.260000(33.62+/-0.35),42.100000-44.080000(43.082+/-0.67)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-2.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Suggested-by: @niftynei
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-1.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
MCP filename change.
Header from folded patch 'tools-bench-gossipd.sh__dont_print_csv_by_default.patch':
tools/bench-gossipd.sh: don't print CSV by default.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Make shellcheck happy.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-08 01:52:54 +02:00
|
|
|
|
|
|
|
rm -f "$DIR"/stats
|
|
|
|
ID=$(wait_for_start)
|
|
|
|
|
|
|
|
while ! grep -q 'gossipd.*: total store load time' "$DIR"/log 2>/dev/null; do
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
if [ -z "${TARGETS##* store_load_msec *}" ]; then
|
|
|
|
grep 'gossipd.*: total store load time' "$DIR"/log | cut -d\ -f7 | print_stat store_load_msec
|
|
|
|
fi
|
|
|
|
|
|
|
|
# How big is gossipd?
|
|
|
|
if [ -z "${TARGETS##* vsz_kb *}" ]; then
|
|
|
|
ps -o vsz= -p "$(pidof lightning_gossipd)" | print_stat vsz_kb
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Now, how long does listnodes take?
|
|
|
|
if [ -z "${TARGETS##* listnodes_sec *}" ]; then
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
/usr/bin/time --append -f %e $LCLI1 listnodes 2>&1 > "$DIR"/listnodes.json | print_stat listnodes_sec
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Now, how long does listchannels take?
|
|
|
|
if [ -z "${TARGETS##* listchannels_sec *}" ]; then
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
/usr/bin/time --append -f %e $LCLI1 listchannels 2>&1 > "$DIR"/listchannels.json | print_stat listchannels_sec
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Now, try routing between first and last points.
|
|
|
|
if [ -z "${TARGETS##* routing_sec *}" ]; then
|
|
|
|
echo "$DIV" | tr -d \\n; DIV=","
|
|
|
|
# shellcheck disable=SC2046
|
|
|
|
# shellcheck disable=SC2005
|
2019-04-08 11:58:44 +02:00
|
|
|
echo $(tr '{}' '\n' < "$DIR"/listnodes.json | grep nodeid | cut -d'"' -f4 | sort | head -n2) | while read -r from to; do
|
2019-04-17 09:33:01 +02:00
|
|
|
# Channels have htlc_min of 10000 msat.
|
tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Outputs CSV. We add some stats for load times in developer mode, so we can
easily read them out.
peer_read_all_sec doesn't work, since we seem to reject about half the
updates for having bad signatures. It's also very slow...
routing fails, for unknown reasons, so that failure is ignored in routing_sec.
Results from 5 runs, min-max(mean +/- stddev):
store_load_msec,vsz_kb,store_rewrite_sec,listnodes_sec,listchannels_sec,routing_sec,peer_write_all_sec
39275-44779(40466.8+/-2.2e+03),2899248,41.010000-44.970000(41.972+/-1.5),2.280000-2.350000(2.304+/-0.025),49.770000-63.390000(59.178+/-5),33.310000-34.260000(33.62+/-0.35),42.100000-44.080000(43.082+/-0.67)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-2.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Suggested-by: @niftynei
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-1.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
MCP filename change.
Header from folded patch 'tools-bench-gossipd.sh__dont_print_csv_by_default.patch':
tools/bench-gossipd.sh: don't print CSV by default.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Make shellcheck happy.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-08 01:52:54 +02:00
|
|
|
# shellcheck disable=SC2086
|
2019-04-17 09:33:01 +02:00
|
|
|
/usr/bin/time --quiet --append -f %e $LCLI1 getroute $from 10000 1 6 $to 2>&1 > /dev/null | print_stat routing_sec
|
tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Outputs CSV. We add some stats for load times in developer mode, so we can
easily read them out.
peer_read_all_sec doesn't work, since we seem to reject about half the
updates for having bad signatures. It's also very slow...
routing fails, for unknown reasons, so that failure is ignored in routing_sec.
Results from 5 runs, min-max(mean +/- stddev):
store_load_msec,vsz_kb,store_rewrite_sec,listnodes_sec,listchannels_sec,routing_sec,peer_write_all_sec
39275-44779(40466.8+/-2.2e+03),2899248,41.010000-44.970000(41.972+/-1.5),2.280000-2.350000(2.304+/-0.025),49.770000-63.390000(59.178+/-5),33.310000-34.260000(33.62+/-0.35),42.100000-44.080000(43.082+/-0.67)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-2.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Suggested-by: @niftynei
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-1.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
MCP filename change.
Header from folded patch 'tools-bench-gossipd.sh__dont_print_csv_by_default.patch':
tools/bench-gossipd.sh: don't print CSV by default.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Make shellcheck happy.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-08 01:52:54 +02:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Try getting all from the peer.
|
|
|
|
if [ -z "${TARGETS##* peer_write_all_sec *}" ]; then
|
2019-04-18 08:36:09 +02:00
|
|
|
ENTRIES=$(grep 'Read .* cannounce/cupdate/nannounce/cdelete' "$DIR"/log | cut -d\ -f5 | tr / + | bc)
|
2019-05-04 07:53:12 +02:00
|
|
|
if [ "$ENTRIES" = 0 ]; then echo "Bad store?"; exit 1; fi
|
2024-06-19 01:56:01 +02:00
|
|
|
/usr/bin/time --quiet --append -f %e devtools/gossipwith --all-gossip --max-messages=$((ENTRIES - 5)) "$ID"@"$DIR"/peer 2>&1 > /dev/null | print_stat peer_write_all_sec
|
tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Outputs CSV. We add some stats for load times in developer mode, so we can
easily read them out.
peer_read_all_sec doesn't work, since we seem to reject about half the
updates for having bad signatures. It's also very slow...
routing fails, for unknown reasons, so that failure is ignored in routing_sec.
Results from 5 runs, min-max(mean +/- stddev):
store_load_msec,vsz_kb,store_rewrite_sec,listnodes_sec,listchannels_sec,routing_sec,peer_write_all_sec
39275-44779(40466.8+/-2.2e+03),2899248,41.010000-44.970000(41.972+/-1.5),2.280000-2.350000(2.304+/-0.025),49.770000-63.390000(59.178+/-5),33.310000-34.260000(33.62+/-0.35),42.100000-44.080000(43.082+/-0.67)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-2.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Suggested-by: @niftynei
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-1.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
MCP filename change.
Header from folded patch 'tools-bench-gossipd.sh__dont_print_csv_by_default.patch':
tools/bench-gossipd.sh: don't print CSV by default.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Make shellcheck happy.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-08 01:52:54 +02:00
|
|
|
fi
|
|
|
|
|
2023-09-21 07:36:28 +02:00
|
|
|
if [ -z "${TARGETS##* peer_read_all_sec *}" ]; then
|
tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Outputs CSV. We add some stats for load times in developer mode, so we can
easily read them out.
peer_read_all_sec doesn't work, since we seem to reject about half the
updates for having bad signatures. It's also very slow...
routing fails, for unknown reasons, so that failure is ignored in routing_sec.
Results from 5 runs, min-max(mean +/- stddev):
store_load_msec,vsz_kb,store_rewrite_sec,listnodes_sec,listchannels_sec,routing_sec,peer_write_all_sec
39275-44779(40466.8+/-2.2e+03),2899248,41.010000-44.970000(41.972+/-1.5),2.280000-2.350000(2.304+/-0.025),49.770000-63.390000(59.178+/-5),33.310000-34.260000(33.62+/-0.35),42.100000-44.080000(43.082+/-0.67)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-2.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Suggested-by: @niftynei
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project-1.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
MCP filename change.
Header from folded patch 'tools-bench-gossipd.sh__dont_print_csv_by_default.patch':
tools/bench-gossipd.sh: don't print CSV by default.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'fixup!_tools-bench-gossipd.sh__rough_benchmark_for_gossipd_and_the_million_channels_project.patch':
fixup! tools/bench-gossipd.sh: rough benchmark for gossipd and the million channels project
Make shellcheck happy.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-04-08 01:52:54 +02:00
|
|
|
# shellcheck disable=SC2086
|
|
|
|
$LCLI1 stop > /dev/null
|
|
|
|
sleep 5
|
|
|
|
# In case they specified dir, don't blow away store.
|
|
|
|
mv "$DIR"/gossip_store "$DIR"/gossip_store.bak
|
|
|
|
rm -f "$DIR"/peer
|
|
|
|
|
|
|
|
$LIGHTNINGD --lightning-dir="$DIR" --log-file="$DIR"/log --bind-addr="$DIR"/peer --log-level=debug &
|
|
|
|
ID=$(wait_for_start)
|
|
|
|
|
|
|
|
# FIXME: Measure this better.
|
|
|
|
EXPECTED=$(find "$DIR"/gossip_store.bak -printf %s)
|
|
|
|
|
|
|
|
START_TIME=$(date +%s)
|
|
|
|
# We send a bad msg at the end, so lightningd hangs up
|
|
|
|
xzcat ../million-channels-project/data/1M/gossip/xa*.xz | devtools/gossipwith --max-messages=1 --stdin "$ID"@"$DIR"/peer 0011 > /dev/null
|
|
|
|
|
|
|
|
while [ "$(find "$DIR"/gossip_store -printf %s)" -lt "$EXPECTED" ]; do
|
|
|
|
sleep 1
|
|
|
|
i=$((i + 1))
|
|
|
|
done
|
|
|
|
END_TIME=$(date +%s)
|
|
|
|
|
|
|
|
echo $((END_TIME - START_TIME)) | print_stat peer_read_all_sec
|
|
|
|
mv "$DIR"/gossip_store.bak "$DIR"/gossip_store
|
|
|
|
fi
|
|
|
|
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
$LCLI1 stop > /dev/null
|