Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
ELEMENTSD_EXEC = "${pkgs.elementsd}/bin/elementsd";
BITCOIND_EXEC = "${pkgs.bitcoind}/bin/bitcoind";

buildInputs = with pkgs; [ heaptrack rocksdb.tools];
buildInputs = with pkgs; [ rocksdb.tools ];
};
}
);
Expand Down
2 changes: 1 addition & 1 deletion src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub struct Arguments {

// TODO make rocksdb parameter conditional on feature db
/// RocksDB point lookup cache size in MB for UTXO and HISTORY column families
#[arg(env, long, default_value = "64")]
#[arg(env, long, default_value = "128")]
pub shared_db_cache_mb: u64,

/// Enable RocksDB statistics collection for detailed metrics
Expand Down
9 changes: 6 additions & 3 deletions src/store/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,12 @@ const VEC_TX_SEEN_MIN_SIZE: usize = 34; // 32 bytes (txid) + 1 byte (height) + 1

impl DBStore {
fn create_cf_descriptors(shared_db_cache_mb: u64) -> Vec<rocksdb::ColumnFamilyDescriptor> {
// Create a shared LRU cache for block-based tables
let cache_size = (shared_db_cache_mb * 1024 * 1024) as usize; // Convert MB to bytes
let shared_cache = Cache::new_lru_cache(cache_size);
let cache_size = (shared_db_cache_mb * 1024 * 1024) as usize;
// HyperClockCache is lock-free, reducing mutex contention under concurrent reads.
// estimated_entry_charge=0 uses the auto-growing variant, which dynamically sizes
// its internal table — safer than a fixed estimate when caching mixed-size entries
// (data blocks, index blocks, filter blocks).
let shared_cache = Cache::new_hyper_clock_cache(cache_size, 0);

COLUMN_FAMILIES
.iter()
Expand Down
Loading