Add max-background-jobs rocksdb option (#1708)

This commit is contained in:
Evgeniy Scherbina 2023-09-14 15:08:26 -04:00 committed by GitHub
parent f934f5961c
commit 3c8394f17a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,6 +55,7 @@ const (
useFsyncDBOptName = "rocksdb.use_fsync" useFsyncDBOptName = "rocksdb.use_fsync"
useAdaptiveMutexDBOptName = "rocksdb.use_adaptive_mutex" useAdaptiveMutexDBOptName = "rocksdb.use_adaptive_mutex"
bytesPerSyncDBOptName = "rocksdb.bytes_per_sync" bytesPerSyncDBOptName = "rocksdb.bytes_per_sync"
maxBackgroundJobsDBOptName = "rocksdb.max-background-jobs"
writeBufferSizeCFOptName = "rocksdb.write-buffer-size" writeBufferSizeCFOptName = "rocksdb.write-buffer-size"
numLevelsCFOptName = "rocksdb.num-levels" numLevelsCFOptName = "rocksdb.num-levels"
@ -173,6 +174,11 @@ func overrideDBOpts(dbOpts *grocksdb.Options, appOpts types.AppOptions) *grocksd
dbOpts.SetBytesPerSync(cast.ToUint64(bytesPerSync)) dbOpts.SetBytesPerSync(cast.ToUint64(bytesPerSync))
} }
maxBackgroundJobs := appOpts.Get(maxBackgroundJobsDBOptName)
if maxBackgroundJobs != nil {
dbOpts.SetMaxBackgroundJobs(cast.ToInt(maxBackgroundJobs))
}
return dbOpts return dbOpts
} }