@ -322,6 +322,14 @@ DEFINE_int32(num_bottom_pri_threads, 0,
" The number of threads in the bottom-priority thread pool (used "
" The number of threads in the bottom-priority thread pool (used "
" by universal compaction only). " ) ;
" by universal compaction only). " ) ;
DEFINE_int32 ( num_high_pri_threads , 0 ,
" The maximum number of concurrent background compactions "
" that can occur in parallel. " ) ;
DEFINE_int32 ( num_low_pri_threads , 0 ,
" The maximum number of concurrent background compactions "
" that can occur in parallel. " ) ;
DEFINE_int32 ( max_background_compactions ,
DEFINE_int32 ( max_background_compactions ,
rocksdb : : Options ( ) . max_background_compactions ,
rocksdb : : Options ( ) . max_background_compactions ,
" The maximum number of concurrent background compactions "
" The maximum number of concurrent background compactions "
@ -5241,13 +5249,14 @@ int db_bench_tool(int argc, char** argv) {
FLAGS_rep_factory = StringToRepFactory ( FLAGS_memtablerep . c_str ( ) ) ;
FLAGS_rep_factory = StringToRepFactory ( FLAGS_memtablerep . c_str ( ) ) ;
// The number of background threads should be at least as much the
// Note options sanitization may increase thread pool sizes according to
// max number of concurrent compactions.
// max_background_flushes/max_background_compactions/max_background_jobs
FLAGS_env - > SetBackgroundThreads ( FLAGS_max_background_compactions ) ;
FLAGS_env - > SetBackgroundThreads ( FLAGS_num_high_pri_threads ,
FLAGS_env - > SetBackgroundThreads ( FLAGS_max_background_flushes ,
rocksdb : : Env : : Priority : : HIGH ) ;
rocksdb : : Env : : Priority : : HIGH ) ;
FLAGS_env - > SetBackgroundThreads ( FLAGS_num_bottom_pri_threads ,
FLAGS_env - > SetBackgroundThreads ( FLAGS_num_bottom_pri_threads ,
rocksdb : : Env : : Priority : : BOTTOM ) ;
rocksdb : : Env : : Priority : : BOTTOM ) ;
FLAGS_env - > SetBackgroundThreads ( FLAGS_num_low_pri_threads ,
rocksdb : : Env : : Priority : : LOW ) ;
// Choose a location for the test database if none given with --db=<path>
// Choose a location for the test database if none given with --db=<path>
if ( FLAGS_db . empty ( ) ) {
if ( FLAGS_db . empty ( ) ) {