From 856e8452d91d2c9c7d6ee3acf2d209766cf35272 Mon Sep 17 00:00:00 2001 From: Yuval Ariel Date: Mon, 25 Dec 2023 13:31:19 +0200 Subject: [PATCH] Options: Set compaction_readahead_size default to 0 --- HISTORY.md | 1 + include/rocksdb/options.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 613f56b61f..56d3a4aaf7 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -16,6 +16,7 @@ Based on RocksDB 8.6.7 ### Miscellaneous * Remove leftover references to ROCKSDB_LITE (#755). +* Options: Set compaction_readahead_size default to 0. The current default of 2Mb is not optimal for most of our use cases. Having a value of 0 means that the FS will use its default size for prefetching (true only with https://github.com/speedb-io/speedb/pull/788). ## Hazlenut 2.7.0 (27/10/2023) Based on RocksDB 8.1.1 diff --git a/include/rocksdb/options.h b/include/rocksdb/options.h index 36d04ea7f4..024385eb9d 100644 --- a/include/rocksdb/options.h +++ b/include/rocksdb/options.h @@ -1005,10 +1005,10 @@ struct DBOptions { // running RocksDB on spinning disks, you should set this to at least 2MB. // That way RocksDB's compaction is doing sequential instead of random reads. // - // Default: 2MB + // Default: 0 // // Dynamically changeable through SetDBOptions() API. - size_t compaction_readahead_size = 2 * 1024 * 1024; + size_t compaction_readahead_size = 0; // This is a maximum buffer size that is used by WinMmapReadableFile in // unbuffered disk I/O mode. We need to maintain an aligned buffer for