From 1861de455eede00202576bc5432787e9ee50a376 Mon Sep 17 00:00:00 2001 From: "Mammo, Mulugeta" Date: Mon, 16 Nov 2020 13:05:21 -0800 Subject: [PATCH] Add arena_block_size flag to db_bench (#7654) Summary: db_bench currently does not allow overriding the default `arena_block_size `calculation ([memtable size/8](https://github.com/facebook/rocksdb/blob/master/db/column_family.cc#L216)). For memtables whose size is in gigabytes, the `arena_block_size` defaults to hundreds of megabytes (affecting performance). Exposing this option in db_bench would allow us to test the workloads with various `arena_block_size` values. Pull Request resolved: https://github.com/facebook/rocksdb/pull/7654 Reviewed By: jay-zhuang Differential Revision: D24996812 Pulled By: ajkr fbshipit-source-id: a5e3d2c83d9f89e1bb8382f2e8dd476c79e33bef --- tools/db_bench_tool.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 322535aef..478a24532 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -323,6 +323,9 @@ DEFINE_int64(db_write_buffer_size, DEFINE_bool(cost_write_buffer_to_cache, false, "The usage of memtable is costed to the block cache"); +DEFINE_int64(arena_block_size, ROCKSDB_NAMESPACE::Options().arena_block_size, + "The size, in bytes, of one block in arena memory allocation."); + DEFINE_int64(write_buffer_size, ROCKSDB_NAMESPACE::Options().write_buffer_size, "Number of bytes to buffer in memtable before compacting"); @@ -3627,6 +3630,7 @@ class Benchmark { options.write_buffer_manager.reset( new WriteBufferManager(FLAGS_db_write_buffer_size, cache_)); } + options.arena_block_size = FLAGS_arena_block_size; options.write_buffer_size = FLAGS_write_buffer_size; options.max_write_buffer_number = FLAGS_max_write_buffer_number; options.min_write_buffer_number_to_merge =