diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 85671e1f7..1aac45698 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -1124,6 +1124,10 @@ DEFINE_bool(rate_limit_auto_wal_flush, false, "false) after the user " "write operation"); +DEFINE_bool(async_io, false, + "When set true, RocksDB does asynchronous reads for internal auto " + "readahead prefetching."); + static enum ROCKSDB_NAMESPACE::CompressionType StringToCompressionType( const char* ctype) { assert(ctype); @@ -3120,6 +3124,7 @@ class Benchmark { read_options_.tailing = FLAGS_use_tailing_iterator; read_options_.readahead_size = FLAGS_readahead_size; read_options_.adaptive_readahead = FLAGS_adaptive_readahead; + read_options_.async_io = FLAGS_async_io; void (Benchmark::*method)(ThreadState*) = nullptr; void (Benchmark::*post_process_method)() = nullptr; @@ -5402,6 +5407,8 @@ class Benchmark { } options.adaptive_readahead = FLAGS_adaptive_readahead; + options.async_io = FLAGS_async_io; + Iterator* iter = db->NewIterator(options); int64_t i = 0; int64_t bytes = 0; @@ -7317,6 +7324,7 @@ class Benchmark { DB* db = SelectDB(thread); ReadOptions ro; ro.adaptive_readahead = FLAGS_adaptive_readahead; + ro.async_io = FLAGS_async_io; ro.rate_limiter_priority = FLAGS_rate_limit_user_ops ? Env::IO_USER : Env::IO_TOTAL; ro.readahead_size = FLAGS_readahead_size; @@ -7331,6 +7339,7 @@ class Benchmark { DB* db = SelectDB(thread); ReadOptions ro; ro.adaptive_readahead = FLAGS_adaptive_readahead; + ro.async_io = FLAGS_async_io; ro.rate_limiter_priority = FLAGS_rate_limit_user_ops ? Env::IO_USER : Env::IO_TOTAL; ro.readahead_size = FLAGS_readahead_size;