-
|
I ran into this issue when trying to tune compaction background threads, and noticing that even though the I tried, on a whim, to set Perhaps something dynamic is happening here and my setting it was necessary for my write-heavy workload, but it contradicts some of the documentation: Per Then looking in Which as I understand it, means I'm not sure if I got lucky, and I'm happy to update the documentation if I can have some help understanding the behaviour here. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
|
@yatriks Thanks for reporting this. The max background jobs wouldn't take effect if one of if (max_background_flushes == -1 && max_background_compactions == -1) {
// for our first stab implementing max_background_jobs, simply allocate a
// quarter of the threads to flushes.
res.max_flushes = std::max(1, max_background_jobs / 4);
res.max_compactions = std::max(1, max_background_jobs - res.max_flushes);
} else {
// compatibility code in case users haven't migrated to max_background_jobs,
// which automatically computes flush/compaction limits
res.max_flushes = std::max(1, max_background_flushes);
res.max_compactions = std::max(1, max_background_compactions);
}See https://github.com/facebook/rocksdb/blob/main/db/db_impl/db_impl_compaction_flush.cc#L3125 Could you please use |
Beta Was this translation helpful? Give feedback.
Yes, we should make the default value to
-1in the codebase.