Skip to content

Commit

Permalink
remove SetLevelCompactionDynamicLevelBytes and add BlockCache
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Jan 19, 2023
1 parent 67ec407 commit 69cdd25
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cmd/cronosd/cmd/open_db_rocksdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ func newRocksdbOptions() *grocksdb.Options {
opts.IncreaseParallelism(runtime.NumCPU())
opts.OptimizeLevelStyleCompaction(512 * 1024 * 1024)
opts.SetTargetFileSizeMultiplier(2)
opts.SetLevelCompactionDynamicLevelBytes(true)

// block based table options
blkOpts := grocksdb.NewDefaultBlockBasedTableOptions()
blkOpts.SetBlockSize(32 * 1024)
blkOpts.SetFilterPolicy(grocksdb.NewRibbonHybridFilterPolicy(9.9, 1))
blkOpts.SetIndexType(grocksdb.KTwoLevelIndexSearchIndexType)
blkOpts.SetPartitionFilters(true)
blkOpts.SetDataBlockIndexType(grocksdb.KDataBlockIndexTypeBinarySearchAndHash)
opts.SetBlockBasedTableFactory(blkOpts)
bbto := grocksdb.NewDefaultBlockBasedTableOptions()
bbto.SetBlockCache(grocksdb.NewLRUCache(1 << 30))
bbto.SetBlockSize(32 * 1024)
bbto.SetFilterPolicy(grocksdb.NewRibbonHybridFilterPolicy(9.9, 1))
bbto.SetIndexType(grocksdb.KTwoLevelIndexSearchIndexType)
bbto.SetPartitionFilters(true)
bbto.SetDataBlockIndexType(grocksdb.KDataBlockIndexTypeBinarySearchAndHash)
opts.SetBlockBasedTableFactory(bbto)
opts.SetOptimizeFiltersForHits(true)

// compression options at bottommost level
Expand Down

0 comments on commit 69cdd25

Please sign in to comment.