From b7d3d6ebc58d3fd2576e09c47b72d8d1ca763bb0 Mon Sep 17 00:00:00 2001 From: sdong Date: Thu, 9 Oct 2014 20:07:12 -0700 Subject: [PATCH] db_bench: set thread pool size according to max_background_flushes Summary: option max_background_flushes doesn't make sense if thread pool size is not set accordingly. Set the thread pool size as what we do for max_background_compactions. Test Plan: Run db_bench with max_background_flushes > 1 Reviewers: yhchiang, igor, rven, ljin Reviewed By: ljin Subscribers: MarkCallaghan, leveldb Differential Revision: https://reviews.facebook.net/D24717 --- db/db_bench.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/db/db_bench.cc b/db/db_bench.cc index f04ab8144..6d611ae1c 100644 --- a/db/db_bench.cc +++ b/db/db_bench.cc @@ -2904,6 +2904,9 @@ int main(int argc, char** argv) { // The number of background threads should be at least as much the // max number of concurrent compactions. FLAGS_env->SetBackgroundThreads(FLAGS_max_background_compactions); + FLAGS_env->SetBackgroundThreads(FLAGS_max_background_flushes, + rocksdb::Env::Priority::HIGH); + // Choose a location for the test database if none given with --db= if (FLAGS_db.empty()) { std::string default_db_path;