Skip to content

Commit

Permalink
Explicitly limit RocksDB logs
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabaNerve committed Mar 8, 2024
1 parent 454beba commit 10f5ec5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions common/db/src/rocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

0 comments on commit 10f5ec5

Please sign in to comment.