Skip to content

Commit

Permalink
tweak badger options
Browse files Browse the repository at this point in the history
  • Loading branch information
walldiss committed Jul 19, 2023
1 parent 7f3fff0 commit d680bd5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions nodebuilder/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d680bd5

Please sign in to comment.