Skip to content

Commit

Permalink
Add max-background-jobs rocksdb option
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-scherbina committed Sep 14, 2023
1 parent f934f59 commit 33b3d5e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/kava/opendb/opendb_rocksdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const (
useFsyncDBOptName = "rocksdb.use_fsync"
useAdaptiveMutexDBOptName = "rocksdb.use_adaptive_mutex"
bytesPerSyncDBOptName = "rocksdb.bytes_per_sync"
maxBackgroundJobsDBOptName = "rocksdb.max-background-jobs"

writeBufferSizeCFOptName = "rocksdb.write-buffer-size"
numLevelsCFOptName = "rocksdb.num-levels"
Expand Down Expand Up @@ -173,6 +174,11 @@ func overrideDBOpts(dbOpts *grocksdb.Options, appOpts types.AppOptions) *grocksd
dbOpts.SetBytesPerSync(cast.ToUint64(bytesPerSync))
}

maxBackgroundJobs := appOpts.Get(maxBackgroundJobsDBOptName)
if maxBackgroundJobs != nil {
dbOpts.SetMaxBackgroundJobs(cast.ToInt(maxBackgroundJobs))
}

return dbOpts
}

Expand Down

0 comments on commit 33b3d5e

Please sign in to comment.