Skip to content

Commit

Permalink
Reduce write buffer size and number for hyper column family
Browse files Browse the repository at this point in the history
  • Loading branch information
aalda committed Apr 3, 2019
1 parent fb625ff commit f7a4b63
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions storage/rocks/rocksdb_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ func NewRocksDBStoreOpts(opts *Options) (*RocksDBStore, error) {

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

// global options
globalOpts := rocksdb.NewDefaultOptions()
Expand Down Expand Up @@ -189,8 +189,8 @@ 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(128 * 1024 * 1024) // 128MB
opts.SetMaxWriteBufferNumber(5)
opts.SetWriteBufferSize(64 * 1024 * 1024) // 128MB
opts.SetMaxWriteBufferNumber(3)
opts.SetMinWriteBufferNumberToMerge(2)
opts.SetLevel0FileNumCompactionTrigger(8)
opts.SetLevel0SlowdownWritesTrigger(17)
Expand Down

0 comments on commit f7a4b63

Please sign in to comment.