Skip to content

Commit fae1e38

Browse files
authored
increase batch-write buffer size (#408)
old: 4MiB/1024 blocks. new: 64MiB/64Ki blocks. This should work better with network-attached storage. My measurements indicate that we're writing less than 8MiB per epoch and around 4K blocks. Previously, that would have been ~4 writes, now it's always one write. fixes filecoin-project/ref-fvm#1786
1 parent 9dc62bc commit fae1e38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rust/src/fvm/blockstore/cgo.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use fvm_ipld_blockstore::Blockstore;
88
use super::super::cgo::*;
99

1010
/// The maximum amount of data to buffer in a batch before writing it to the underlying blockstore.
11-
const MAX_BUF_SIZE: usize = 4 << 20; // 4MiB
11+
const MAX_BUF_SIZE: usize = 64 << 20; // 64MiB
1212
/// The maximum number of blocks to buffer in a batch before before writing it to the underlying
13-
/// blockstore.
14-
const MAX_BLOCK_BATCH: usize = 1024;
13+
/// blockstore. This will allocate 0.5MiB of memory to store offsets.
14+
const MAX_BLOCK_BATCH: usize = 64 << 10;
1515

1616
pub struct CgoBlockstore {
1717
handle: u64,

0 commit comments

Comments
 (0)