performance tracking
Lederstrumpf opened this issue · 0 comments
To benchmark the improvement from #789, I analysed the latency of messages between maker receiving TakerCommit
and sending out Reveal
, since @TheCharlatan reported seeing massive latencies between these on fc.dev (mostly running 50 swaps in parallel), and which we suspected to be due to walletd
being a bottleneck, likely due to a queue of dleq proofs to produce.
Below is the CDF of latencies between maker receiving TakerCommit
and sending out Reveal
, comparing #789 with ed4247f (#792).
Although we also merged some other PRs inbetween, these were almost certainly unrelated, and I think the data confirms the suspicions was true:
For later reproducibility, the data is bash foo'd from our logs as follows:
timedifference() {echo $(($(date --date=$2 +"%s") - $(date --date=$1 +"%s")))}
swap_file=reveal_latency_takercommit_789.log;
taker_commit_regex="INFO.+Received TakerCommit"
reveal_regex="INFO.+Sent the reveal"
timestamp_regex="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z"
journalctl -u farcasterd.service --since "2022-12-06 17:00" --until "now" | rg "$taker_commit_regex|$reveal_regex" > $swap_file
for swap in `cat $swap_file | rg "0x....…...." -o | uniq`; do
taker_commit=`rg "$swap" $swap_file | rg $taker_commit_regex | tail -n 1 | rg $timestamp_regex -o`;
reveal=`rg "$swap" $swap_file | rg $reveal_regex | head -n 1 | rg $timestamp_regex -o`;
if [[ -z $reveal || -z $taker_commit ]]; then else
timedifference $taker_commit $reveal;
fi;
unset taker_commit; unset reveal;
done > $swap_file.latencies.dat
This can then be piped on via sort -n | uniq -c
for a rudimentary histogram ^^
I'd like to use this issue to track performance in future too, both for future performance improvements and for stress testing with more than 50 concurrent swaps to identify the next frontier of bottlenecks (although I should be done with my performance junkie fix now :P).