From 7b11d48444a05fcc48da9df73fa1d23e576448fa Mon Sep 17 00:00:00 2001 From: anand76 Date: Wed, 14 Sep 2022 08:51:16 -0700 Subject: [PATCH] Change MultiGet multi-level optimization to default on (#10671) Summary: Change the ```ReadOptions.optimize_multiget_for_io``` flag to default on. It doesn't impact regular MultiGet users as its only applicable when ```ReadOptions.async_io``` is also set to true. Pull Request resolved: https://github.com/facebook/rocksdb/pull/10671 Reviewed By: akankshamahajan15 Differential Revision: D39477439 Pulled By: anand1976 fbshipit-source-id: 47abcdbfa69f9bc60422ab68a238b232e085d4ba --- HISTORY.md | 1 + include/rocksdb/options.h | 2 +- options/options.cc | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 005e6f481..9cea81b18 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -25,6 +25,7 @@ * When a block is firstly evicted from the primary cache to `CompressedSecondaryCache`, we just insert a dummy block in `CompressedSecondaryCache`. Only if it is evicted again before the dummy block is evicted from the cache, it is treated as a hot block and is inserted into `CompressedSecondaryCache`. * Improved the estimation of memory used by cached blobs by taking into account the size of the object owning the blob value and also the allocator overhead if `malloc_usable_size` is available (see #10583). * Blob values now have their own category in the cache occupancy statistics, as opposed to being lumped into the "Misc" bucket (see #10601). +* Change the optimize_multiget_for_io experimental ReadOptions flag to default on. ### New Features * RocksDB does internal auto prefetching if it notices 2 sequential reads if readahead_size is not specified. New option `num_file_reads_for_auto_readahead` is added in BlockBasedTableOptions which indicates after how many sequential reads internal auto prefetching should be start (default is 2). diff --git a/include/rocksdb/options.h b/include/rocksdb/options.h index 72b36dbf5..3ba13d129 100644 --- a/include/rocksdb/options.h +++ b/include/rocksdb/options.h @@ -1697,7 +1697,7 @@ struct ReadOptions { // parallel if the keys in the MultiGet batch are in different levels. It // comes at the expense of slightly higher CPU overhead. // - // Default: false + // Default: true bool optimize_multiget_for_io; ReadOptions(); diff --git a/options/options.cc b/options/options.cc index 6f5691515..ea1364416 100644 --- a/options/options.cc +++ b/options/options.cc @@ -697,7 +697,7 @@ ReadOptions::ReadOptions() value_size_soft_limit(std::numeric_limits::max()), adaptive_readahead(false), async_io(false), - optimize_multiget_for_io(false) {} + optimize_multiget_for_io(true) {} ReadOptions::ReadOptions(bool cksum, bool cache) : snapshot(nullptr), @@ -723,6 +723,6 @@ ReadOptions::ReadOptions(bool cksum, bool cache) value_size_soft_limit(std::numeric_limits::max()), adaptive_readahead(false), async_io(false), - optimize_multiget_for_io(false) {} + optimize_multiget_for_io(true) {} } // namespace ROCKSDB_NAMESPACE