Skip to content

Commit

Permalink
Activate partitioned index filters.
Browse files Browse the repository at this point in the history
Reduce number of open files.
  • Loading branch information
aalda committed Apr 4, 2019
1 parent 66df51e commit 9042614
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions storage/rocks/rocksdb_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func NewRocksDBStoreOpts(opts *Options) (*RocksDBStore, error) {
globalOpts := rocksdb.NewDefaultOptions()
globalOpts.SetCreateIfMissing(true)
globalOpts.SetCreateIfMissingColumnFamilies(true)
//globalOpts.SetMaxOpenFiles()
globalOpts.SetMaxOpenFiles(100)
globalOpts.SetEnv(env)
// We build a LRU cache with a high pool ratio of 0.4 (40%). The lower pool
// will cache data blocks and the higher will cache index and filters.
Expand Down Expand Up @@ -152,7 +152,7 @@ func getHyperCacheTableOpts(blockCache *rocksdb.Cache) *rocksdb.Options {
// touched on every operation.

bbto := rocksdb.NewDefaultBlockBasedTableOptions()
bbto.SetFilterPolicy(rocksdb.NewBloomFilterPolicy(10))
bbto.SetFilterPolicy(rocksdb.NewFullBloomFilterPolicy(10))
// In order to have a fine-grained control over the memory usage
// we cache SST's index and filters in the block cache. The alternative
// would be to leave RocksDB keep those files memory mapped, but
Expand All @@ -163,6 +163,9 @@ func getHyperCacheTableOpts(blockCache *rocksdb.Cache) *rocksdb.Options {
// those from L0 and move them to the high priority pool.
bbto.SetPinL0FilterAndIndexBlocksInCache(true)
bbto.SetCacheIndexAndFilterBlocksWithHighPriority(true)
bbto.SetPinTopLevelIndexAndFilterInCache(true)
bbto.SetPartitionFilters(true)
bbto.SetIndexType(rocksdb.KTwoLevelIndexSearchIndexType)
bbto.SetBlockCache(blockCache)
// increase block size to 16KB
bbto.SetBlockSize(16 * 1024)
Expand Down

0 comments on commit 9042614

Please sign in to comment.