-
Notifications
You must be signed in to change notification settings - Fork 4
Prune & Compaction Optimization #33
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
Conversation
|
LGTM but I'd have a look at the tests |
|
Thanks @marcello33 Yes, the changes are these ones. I already launched the tag since it was a minor change so I assumed this review to cover that one too. Some of the tests were failing before but now I see some news were failing. I'll check it today |
|



After our first simulations we saw a big challenge on Pruning and Compaction the node's data while keeping it online.
As we can see on the image bellow which follows CPU and memory. We enabled compaction and prune at the second start on a simulation which led to a memory spike of 50GB and also shows that after that the consumption still higher than usual scenario.
So the consequences were:
After some research we realized the reason was because:
.Compact(nil,nil)which runs through the whole db when it should be split in small prefix rangesCompactSharded256,CompactPrefixHex256andCompactIntShardedcometbft-dbfrom0.14.1to0.14.1-polygonbatch.Write()instead ofbatch.WriteSync()and some sleep. Which does not let the fls flush from L0 to lower levelsdefersin loop1instead ofinitialHeightWith data we reached a solution where no spikes are found while compacting 4.7 million of blocks in a heimdall mainnet node as we can see in the image below.
PS.: The only spike we can see is the one at start, which is usual and happens both with pruning enable or not
PS2.: Note that the memory usage still almost the same from heimdall.
And finally here's is it how it looks like a pruning and deletion on a heimdall mainnet node:
PR checklist
.changelog(we use unclog to manage our changelog)docs/orspec/) and code comments