-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
- `db-analyser --benchmark-ledger-ops` lists the fixed stats, and then for Byron and Shelley it currently also lists the number of txs and the total size of the txs. | ||
|
||
- `db-analyser --show-block-header-size` lists the size of the block's header. | ||
I ran a patched version that also simply includes the block size. | ||
|
||
- `MsgBlock` has an overhead of 2 bytes (ie the list length and the word tag, since both are <24). | ||
|
||
- I _think_ `network-mux`'s SDU overhead is 8 bytes, from https://github.com/IntersectMBO/ouroboros-network/blob/db61131c2f375842f0930a8a9cf7f83b0cb80992/network-mux/src/Network/Mux/Codec.hs#L28-L40. | ||
However, I don't know how many SDUs each byte requires. | ||
So I'll omit this. | ||
|
||
Thus the number of bytes in each block that are carried by the `network-mux` is: 2 + 1 + hdrSize + txSize. | ||
|
||
----- | ||
|
||
The basic idea of this simple script is to divide real-world time up into non-overlapping 10 second chunks. | ||
We use only mutator time, essentially assuming that GC is instantaneous; this conservatively _over_-estimates the effective bit rate. | ||
Map each chunk to the set of blocks whose validation began during that chunk. | ||
Then divide the sum of the validation mutator duration for each block by the sum of the on-the-wire size of each. | ||
|
||
First, a sanity check. | ||
|
||
``` | ||
$ cat show-block-header-size.txt | awk '($4 != "SlotNo") {print $0} ($6 != "header") {print $0}' | ||
[0.834136s] Started ShowBlockHeaderSize | ||
[0.834136s] Started ShowBlockHeaderSize | ||
[1926.666379s] Maximum encountered header size = 1012 | ||
[1926.666379s] Maximum encountered header size = 1012 | ||
[1926.666504s] Done | ||
[1926.666504s] Done | ||
ImmutableDB tip: At (Block {blockPointSlot = SlotNo 133220620, blockPointHash = 8b0597e7cf5c65b9d00af8a162d30eaae6647f868224004b02d7bd30e1d3f93f}) | ||
ImmutableDB tip: At (Block {blockPointSlot = SlotNo 133220620, blockPointHash = 8b0597e7cf5c65b9d00af8a162d30eaae6647f868224004b02d7bd30e1d3f93f}) | ||
``` | ||
|
||
Then, the real plot as well as another sanity check of the number of blocks mapped to each 10 second chunk of mutator time. | ||
|
||
The assumed inputs are benchmark-ledger-ops.csv and patched-show-block-header-sizes.txt, where the latter used a patched `db-analyser` to include an additional column for `GetBlockSize`. | ||
(The sum of the `txSizes` in the `..era-specific stats` is a slight underestimate.) | ||
|
||
``` | ||
$ cat benchmark-ledger-ops.csv | cut -d' ' -f1,12,13 | tail -n+2 >SlotNo-BodyTickDur-BodyAppDur.txt | ||
$ paste SlotNo-BodyTickDur-BodyAppDur.txt <(tail -n+2 patched-show-block-header-sizes.txt) | gawk 'BEGIN {CONVFMT="%.18g" } ($1 != $8) { exit} {x = x + $2 + $3; y = y + 2 + $14; print $1, x, y}' > SlotNo-CumuDur-CumuSize.txt | ||
$ cat SlotNo-CumuDur-CumuSize.txt | gawk 'BEGIN {w = 10; CONVFMT="%.18g"; prevX = -1; prevY = 0; prevZ = 0} {x = int($2 / (1000 * 1000 * w)); y = $3} (x != prevX) {print $1, (y - prevY) / w * 8 / (1000*1000), NR - prevZ; prevY = y; prevZ = NR} {prevX = x}' >catch | ||
$ tail -n1 SlotNo-CumuDur-CumuSize.txt | ||
133075481 140291882237 190610147733 | ||
$ head -n1000 gp.scr* | ||
==> gp.scr <== | ||
set multiplot layout 2,1 | ||
|
||
set title 'Validation Bit Rate (on an AMD EPYC 7702P)' | ||
|
||
set xlabel 'slot number of the last block in each 10 second chunk (millions of slots)' | ||
set ylabel 'bytes validated per 10 second chunk of mutator time (megabits per second)' | ||
|
||
plot 'catch' using 1:2 notitle | ||
|
||
set yrange [0:25] | ||
|
||
unset title | ||
set xlabel 'same' | ||
set ylabel 'same, clamped to 25' | ||
|
||
plot 'catch' using 1:($2 > 25 ? 25 : $2) notitle | ||
|
||
==> gp.scr2 <== | ||
set xlabel 'slot number of the last block in each 10 second chunk (millions of slots)' | ||
set ylabel 'blocks per 10 second chunk of mutator time, clamped to 1000' | ||
|
||
plot 'catch' using 1:(1000 < $3 ? 1000 : $3) notitle | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
set multiplot layout 2,1 | ||
|
||
set title 'Validation Bit Rate' | ||
|
||
set xlabel 'slot number of the last block in each 10 second chunk (millions of slots)' | ||
set ylabel 'bytes validated per 10 second chunk of mutator time (megabits per second)' | ||
|
||
plot 'catch' using ($1 / 1000000):2 notitle | ||
|
||
set yrange [0:25] | ||
|
||
unset title | ||
set xlabel 'same' | ||
set ylabel 'same, clamped to 25' | ||
|
||
plot 'catch' using ($1 / 1000000):($2 > 25 ? 25 : $2) notitle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set xlabel 'slot number (at end of each 10 second chunk)' | ||
set ylabel 'blocks per 10 second chunk of mutator time, clamped to 1000' | ||
|
||
plot 'catch' using 1:(1000 < $3 ? 1000 : $3) notitle |