Skip to content

Commit

Permalink
Fix RocksDB cache level size
Browse files Browse the repository at this point in the history
The L1 cache size was misconfigured to 1TB causing stalling.
  • Loading branch information
suizman committed Apr 11, 2019
1 parent c8a5544 commit 04ce872
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions storage/rocks/rocksdb_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func NewRocksDBStoreOpts(opts *Options) (*RocksDBStore, error) {

// env
env := rocksdb.NewDefaultEnv()
env.SetBackgroundThreads(3)
env.SetBackgroundThreads(5)
env.SetHighPriorityBackgroundThreads(3)

// global options
Expand Down Expand Up @@ -193,20 +193,20 @@ func getHyperCacheTableOpts(blockCache *rocksdb.Cache) *rocksdb.Options {
// L2 size = 64MB (target_file_base) * 8^3 (target_file_size_multiplier)
// = 32GB = 512 (max_bytes_for_level_base) * 8^2 (max_bytes_for_level_multiplier)
// ...
opts.SetWriteBufferSize(64 * 1024 * 1024) // 128MB
opts.SetWriteBufferSize(64 * 1024 * 1024) // 64MB
opts.SetMaxWriteBufferNumber(3)
opts.SetMinWriteBufferNumberToMerge(2)
opts.SetLevel0FileNumCompactionTrigger(8)
opts.SetLevel0SlowdownWritesTrigger(17)
opts.SetLevel0StopWritesTrigger(24)
opts.SetTargetFileSizeBase(128 * 1024 * 1024) // 128MB
opts.SetTargetFileSizeBase(64 * 1024 * 1024) // 64MB
opts.SetTargetFileSizeMultiplier(8)
opts.SetMaxBytesForLevelBase(1024 * 1024 * 1024 * 1024) // 1GB
opts.SetMaxBytesForLevelBase(512 * 1024 * 1024) // 512MB
opts.SetMaxBytesForLevelMultiplier(8)
opts.SetNumLevels(7)

// io parallelism
opts.SetMaxBackgroundCompactions(4)
opts.SetMaxBackgroundCompactions(8)
opts.SetMaxBackgroundFlushes(1)
return opts
}
Expand Down Expand Up @@ -258,12 +258,12 @@ func getHistoryCacheTableOpts(blockCache *rocksdb.Cache) *rocksdb.Options {
opts.SetLevel0StopWritesTrigger(24)
opts.SetTargetFileSizeBase(64 * 1024 * 1024) // 64MB
opts.SetTargetFileSizeMultiplier(8)
opts.SetMaxBytesForLevelBase(512 * 1024 * 1024 * 1024) // 512MB
opts.SetMaxBytesForLevelBase(512 * 1024 * 1024) // 512MB
opts.SetMaxBytesForLevelMultiplier(8)
opts.SetNumLevels(5)

// io parallelism
opts.SetMaxBackgroundCompactions(4)
opts.SetMaxBackgroundCompactions(8)
opts.SetMaxBackgroundFlushes(1)
return opts
}
Expand Down

0 comments on commit 04ce872

Please sign in to comment.