IAVL v2 benchmarks from osmosis mainnet testing #857
Replies: 1 comment
-
Impressive speedups! This is amazing! Thank you so much for including the pprof's btw, its helped a lot for speeding up / investigating the code! Though it is a bit unclear to me why we can conclude that Commit is not a bottleneck to the state machine, until async commit lands. Seems to be 900s out of the 2 hour CPU profile IAVL v2 benchmark (which counts time multiple times for each thread doing compute AFAIU). (900s looking at the cacheKV write process, and the IAVL commit process) This is 12% of the profile time! Also a lot of the CPU time taken from the main Osmosis state machine thread seems very eliminatable / silly stuff! Got a few PR's in that should reduce the 2800s -> 2400s (one requires a state break :( ). The CGO issue for WASM is harder to eliminate though. |
Beta Was this translation helpful? Give feedback.
-
I briefly shared these benchmarks from osmosis mainnet testing of iavl v2 in an SDK team call this morning. There was some interest in how they were collected, and a request to provide some shareable links or resources for peer review.
Methodology
Versions of code used in this benchmark:
--use-iavl-v2
flag: 01builders/osmosis@4849910Performance of 2 osmosis binaries were compared (one with iavl v0, the other iavl v2) by syncing from block 12,252,638 to block 12,272,529. The state starting point is the snapshot
osmosis-1-pruned.20231108.0910.tar.lz4
, obtained from quicksync.io around Nov 8 2023.Prometheus time series metrics and go CPU profiles were collected. A local prometheus instance scraped the remote node running the osmosis binary.
Findings
(TL;DR)
IAVL v2 shows the following performance improvements over v0:
Prometheus
IAVL v2 metrics showing commit rate, commit, get, set & delete latency:
v2 grafana dashboard snapshot
IAVL v0 metrics showing commit rate, commit, get, set & delete latency:
v0 grafana dashboard snapshot
CPU Profile
From these flame graphs we can see that I/O time is reduced, osmosis does not appear i/o blocked from iavl with v2, other areas are consuming the majority of computation. In particular we notice the leveldb compactions from CometBFT's blockstore, wasmvm CGO calls, and (in epoch blocks) math computations.
IAVL v2:
CPU Profile: bench_aws_cpuprofile_iavlv2_latest_12252638-12272529.out.gz
IAVL v0:
CPU profile: bench_iavlv0_12252638-12272529.out.gz
Reflections
Beta Was this translation helpful? Give feedback.
All reactions