Skip to content
Merged
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Perf

### 2025-11-10
- Disable RocksDB compression [#5223](https://github.com/lambdaclass/ethrex/pull/5223)

### 2025-11-07
- Reuse stack pool in LEVM [#5179](https://github.com/lambdaclass/ethrex/pull/5179)

Expand Down
12 changes: 0 additions & 12 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ uuid = { version = "1.18.1", features = ["v4"] }
tower-http = { version = "0.6.2", features = ["cors"] }
indexmap = { version = "2.11.4" }

rocksdb = "0.24.0"
rocksdb = { version="0.24.0", default-features = false, features = ["bindgen-runtime"] }

[patch.crates-io]
secp256k1 = { git = "https://github.com/sp1-patches/rust-secp256k1", tag = "patch-0.30.0-sp1-5.0.0" }
Expand Down
20 changes: 15 additions & 5 deletions crates/storage/store_db/rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ impl Store {
db_options.set_enable_write_thread_adaptive_yield(true);
db_options.set_compaction_readahead_size(4 * 1024 * 1024); // 4MB
db_options.set_advise_random_on_open(false);
db_options.set_compression_type(rocksdb::DBCompressionType::None);
db_options.set_bottommost_compression_type(rocksdb::DBCompressionType::None);

// db_options.enable_statistics();
// db_options.set_stats_dump_period_sec(600);
Expand Down Expand Up @@ -239,10 +241,10 @@ impl Store {
cf_opts.set_level_zero_file_num_compaction_trigger(4);
cf_opts.set_level_zero_slowdown_writes_trigger(20);
cf_opts.set_level_zero_stop_writes_trigger(36);
cf_opts.set_compression_type(rocksdb::DBCompressionType::None);

match cf_name.as_str() {
CF_HEADERS | CF_BODIES => {
cf_opts.set_compression_type(rocksdb::DBCompressionType::Zstd);
cf_opts.set_write_buffer_size(128 * 1024 * 1024); // 128MB
cf_opts.set_max_write_buffer_number(4);
cf_opts.set_target_file_size_base(256 * 1024 * 1024); // 256MB
Expand All @@ -252,7 +254,6 @@ impl Store {
cf_opts.set_block_based_table_factory(&block_opts);
}
CF_CANONICAL_BLOCK_HASHES | CF_BLOCK_NUMBERS => {
cf_opts.set_compression_type(rocksdb::DBCompressionType::Lz4);
cf_opts.set_write_buffer_size(64 * 1024 * 1024); // 64MB
cf_opts.set_max_write_buffer_number(3);
cf_opts.set_target_file_size_base(128 * 1024 * 1024); // 128MB
Expand All @@ -263,7 +264,18 @@ impl Store {
cf_opts.set_block_based_table_factory(&block_opts);
}
CF_TRIE_NODES => {
cf_opts.set_compression_type(rocksdb::DBCompressionType::Lz4);
cf_opts.set_write_buffer_size(512 * 1024 * 1024); // 512MB
cf_opts.set_max_write_buffer_number(6);
cf_opts.set_min_write_buffer_number_to_merge(2);
cf_opts.set_target_file_size_base(256 * 1024 * 1024); // 256MB
cf_opts.set_memtable_prefix_bloom_ratio(0.2); // Bloom filter

let mut block_opts = BlockBasedOptions::default();
block_opts.set_block_size(16 * 1024); // 16KB
block_opts.set_bloom_filter(10.0, false); // 10 bits per key
cf_opts.set_block_based_table_factory(&block_opts);
}
CF_FLATKEYVALUE => {
cf_opts.set_write_buffer_size(512 * 1024 * 1024); // 512MB
cf_opts.set_max_write_buffer_number(6);
cf_opts.set_min_write_buffer_number_to_merge(2);
Expand All @@ -276,7 +288,6 @@ impl Store {
cf_opts.set_block_based_table_factory(&block_opts);
}
CF_RECEIPTS | CF_ACCOUNT_CODES => {
cf_opts.set_compression_type(rocksdb::DBCompressionType::Lz4);
cf_opts.set_write_buffer_size(128 * 1024 * 1024); // 128MB
cf_opts.set_max_write_buffer_number(3);
cf_opts.set_target_file_size_base(256 * 1024 * 1024); // 256MB
Expand All @@ -287,7 +298,6 @@ impl Store {
}
_ => {
// Default for other CFs
cf_opts.set_compression_type(rocksdb::DBCompressionType::Lz4);
cf_opts.set_write_buffer_size(64 * 1024 * 1024); // 64MB
cf_opts.set_max_write_buffer_number(3);
cf_opts.set_target_file_size_base(128 * 1024 * 1024); // 128MB
Expand Down
Loading