Skip to content

Commit

Permalink
Add max-background-jobs rocksdb option (#1708) (#1716)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3c8394f)

Co-authored-by: Evgeniy Scherbina <evgeniy.shcherbina.es@gmail.com>
  • Loading branch information
2 people authored and pirtleshell committed Oct 25, 2023
1 parent e35747a commit a442d20
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 a442d20

Please sign in to comment.