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

performance tracking #810

Open
Lederstrumpf opened this issue Dec 9, 2022 · 0 comments
Open

performance tracking #810

Lederstrumpf opened this issue Dec 9, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Lederstrumpf
Copy link
Member

Lederstrumpf commented Dec 9, 2022

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:

reveal_latency_PR_789


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).

@Lederstrumpf Lederstrumpf added the enhancement New feature or request label Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant