mirror of
https://github.com/vacp2p/linea-besu.git
synced 2026-01-08 20:47:59 -05:00
Optimize RocksDB WAL file (#6328)
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
This commit is contained in:
@@ -77,6 +77,11 @@ public abstract class RocksDBColumnarKeyValueStorage implements SegmentedKeyValu
|
||||
protected static final long ROCKSDB_BLOCKCACHE_SIZE_HIGH_SPEC = 1_073_741_824L;
|
||||
/** RocksDb memtable size when using the high spec option */
|
||||
protected static final long ROCKSDB_MEMTABLE_SIZE_HIGH_SPEC = 1_073_741_824L;
|
||||
/** Max total size of all WAL file, after which a flush is triggered */
|
||||
protected static final long WAL_MAX_TOTAL_SIZE = 1_073_741_824L;
|
||||
/** Expected size of a single WAL file, to determine how many WAL files to keep around */
|
||||
protected static final long EXPECTED_WAL_FILE_SIZE = 67_108_864L;
|
||||
|
||||
/** RocksDb number of log files to keep on disk */
|
||||
private static final long NUMBER_OF_LOG_FILES_TO_KEEP = 7;
|
||||
/** RocksDb Time to roll a log file (1 day = 3600 * 24 seconds) */
|
||||
@@ -237,6 +242,8 @@ public abstract class RocksDBColumnarKeyValueStorage implements SegmentedKeyValu
|
||||
options
|
||||
.setCreateIfMissing(true)
|
||||
.setMaxOpenFiles(configuration.getMaxOpenFiles())
|
||||
.setMaxTotalWalSize(WAL_MAX_TOTAL_SIZE)
|
||||
.setRecycleLogFileNum(WAL_MAX_TOTAL_SIZE / EXPECTED_WAL_FILE_SIZE)
|
||||
.setStatistics(stats)
|
||||
.setCreateMissingColumnFamilies(true)
|
||||
.setLogFileTimeToRoll(TIME_TO_ROLL_LOG_FILE)
|
||||
|
||||
Reference in New Issue
Block a user