From 10f5ec51ca86bccd18cc1b7b2a9108359a612171 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Fri, 8 Mar 2024 09:19:34 -0500 Subject: [PATCH] Explicitly limit RocksDB logs --- common/db/src/rocks.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/db/src/rocks.rs b/common/db/src/rocks.rs index 74fd33adc..01762151c 100644 --- a/common/db/src/rocks.rs +++ b/common/db/src/rocks.rs @@ -38,5 +38,12 @@ pub fn new_rocksdb(path: &str) -> RocksDB { let mut options = Options::default(); options.create_if_missing(true); options.set_compression_type(DBCompressionType::Lz4); + options.set_wal_size_limit_mb(128); + // 1 GB + options.set_max_total_wal_size(1 << 30); + // 128 MB + options.set_max_log_file_size(1 << 27); + options.set_recycle_log_file_num(5); + options.set_keep_log_file_num(5); Arc::new(TransactionDB::open(&options, &Default::default(), path).unwrap()) }