Skip to content

Commit 152d509

Browse files
committed
Test changes
1 parent bdf0dd6 commit 152d509

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

linera-views/src/backends/rocks_db.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ const MAX_VALUE_SIZE: usize = 3221225072;
4949
// 8388608 and so for offset reason we decrease by 400
5050
const MAX_KEY_SIZE: usize = 8388208;
5151

52-
const DB_CACHE_SIZE: usize = 128 * 1024 * 1024; // 128 MiB
53-
const DB_MAX_WRITE_BUFFER_NUMBER: i32 = 8;
52+
const WRITE_BUFFER_SIZE: usize = 256 * 1024 * 1024; // 256 MiB
53+
const MAX_WRITE_BUFFER_NUMBER: i32 = 64;
5454

5555
/// The RocksDB client that we use.
5656
type DB = rocksdb::DBWithThreadMode<rocksdb::MultiThreaded>;
@@ -304,15 +304,13 @@ impl RocksDbStoreInternal {
304304
options.create_if_missing(true);
305305
options.create_missing_column_families(true);
306306
// Flush in-memory buffer to disk more often
307-
options.set_write_buffer_size(DB_CACHE_SIZE);
308-
options.set_max_write_buffer_number(DB_MAX_WRITE_BUFFER_NUMBER);
307+
options.set_write_buffer_size(WRITE_BUFFER_SIZE);
308+
options.set_max_write_buffer_number(MAX_WRITE_BUFFER_NUMBER);
309309
options.set_compression_type(rocksdb::DBCompressionType::Lz4);
310310
options.set_level_zero_slowdown_writes_trigger(-1);
311-
options.set_level_zero_stop_writes_trigger(48);
312-
options.set_stats_dump_period_sec(60);
313-
options.enable_statistics();
311+
options.set_level_zero_stop_writes_trigger(MAX_WRITE_BUFFER_NUMBER);
314312
options.increase_parallelism(num_cpus::get() as i32);
315-
options.set_max_background_jobs(8);
313+
options.set_max_background_jobs(num_cpus::get() as i32);
316314
options.set_level_compaction_dynamic_level_bytes(true);
317315

318316
let db = DB::open(&options, path_buf)?;

0 commit comments

Comments
 (0)