Skip to content

Commit

Permalink
Update DBOptions::IncreaseParallelism to use newer background settings
Browse files Browse the repository at this point in the history
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 -
cockroachdb/cockroach#19699 (comment)
Closes facebook#3208

Differential Revision: D6473178

Pulled By: ajkr

fbshipit-source-id: 67c892ceb7b1909d251492640cb15a0f2262b7ed
  • Loading branch information
a-robinson authored and facebook-github-bot committed Dec 4, 2017
1 parent 57056bb commit 4634c73
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions options/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4634c73

Please sign in to comment.