Update DBOptions::IncreaseParallelism to use newer background settings

Summary:
The Options header file recommends using max_background_jobs rather than
directly setting max_background_compactions or max_background_flushes.

I've personally seen a performance problem where stalls were happening
because the one background flushing thread was blocked that was fixed
by this change -
https://github.com/cockroachdb/cockroach/issues/19699#issuecomment-347672485
Closes https://github.com/facebook/rocksdb/pull/3208

Differential Revision: D6473178

Pulled By: ajkr

fbshipit-source-id: 67c892ceb7b1909d251492640cb15a0f2262b7ed
This commit is contained in:
Alex Robinson 2017-12-04 01:53:49 -08:00 committed by Facebook Github Bot
parent 57056bb606
commit 4634c735a8

View File

@ -503,8 +503,7 @@ ColumnFamilyOptions* ColumnFamilyOptions::OptimizeUniversalStyleCompaction(
}
DBOptions* DBOptions::IncreaseParallelism(int total_threads) {
max_background_compactions = total_threads - 1;
max_background_flushes = 1;
max_background_jobs = total_threads;
env->SetBackgroundThreads(total_threads, Env::LOW);
env->SetBackgroundThreads(1, Env::HIGH);
return this;