From 3c8394f17a341ee9da3fdd8f884bb9de6b3f71da Mon Sep 17 00:00:00 2001 From: Evgeniy Scherbina Date: Thu, 14 Sep 2023 15:08:26 -0400 Subject: [PATCH] Add max-background-jobs rocksdb option (#1708) --- cmd/kava/opendb/opendb_rocksdb.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/kava/opendb/opendb_rocksdb.go b/cmd/kava/opendb/opendb_rocksdb.go index 35368c62..99e82043 100644 --- a/cmd/kava/opendb/opendb_rocksdb.go +++ b/cmd/kava/opendb/opendb_rocksdb.go @@ -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" @@ -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 }