From d680bd526f045cd4ddfba2ac7e1ce71704dacacc Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 19 Jul 2023 14:28:45 +0300 Subject: [PATCH] tweak badger options --- nodebuilder/store.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/nodebuilder/store.go b/nodebuilder/store.go index 05805da3da..0dfa9504c9 100644 --- a/nodebuilder/store.go +++ b/nodebuilder/store.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/dgraph-io/badger/v4/options" "github.com/ipfs/go-datastore" "github.com/mitchellh/go-homedir" "path/filepath" @@ -117,6 +118,24 @@ func (f *fsStore) Datastore() (datastore.Batching, error) { } opts := dsbadger.DefaultOptions // this should be copied + //opts.DetectConflicts = true + + opts.Compression = 0 + opts.MemTableSize = 64 * 8 << 20 + opts.BaseTableSize = 2 * 16 << 20 + opts.BaseLevelSize = 10 * 8 << 20 + opts.TableSizeMultiplier = 2 + opts.LevelSizeMultiplier = 100 + + opts.NumCompactors = 4 // Run at least 2 compactors. Zero-th compactor prioritizes L0. + opts.NumLevelZeroTables = 5 * 10 + opts.NumLevelZeroTablesStall = 15 * 10 + opts.NumMemtables = 5 + opts.BloomFalsePositive = 0.01 + opts.BlockSize = 4 * 16 * 1024 + opts.Compression = options.None + opts.BlockCacheSize = 256 << 20 + opts.IndexCacheSize = 100 << 20 // TODO: probably not needed // Badger sets ValueThreshold to 1K by default and this makes shares being stored in LSM tree // instead of the value log, so we change the value to be lower than share size,