@@ -101,43 +101,20 @@ pub struct Options {
101101 long = "rocksdb.block-cache-size" ,
102102 value_name = "BYTES" ,
103103 default_value_t = ethrex_storage:: DEFAULT_ROCKSDB_BLOCK_CACHE_SIZE_BYTES ,
104- help = "RocksDB shared block cache size in bytes (default 20 GiB). \
105- Lowering this degrades block-import throughput; see --help for details.",
106- long_help = "RocksDB shared block cache size in bytes. This single bounded LRU cache \
107- holds both data blocks AND the per-SST index and bloom-filter blocks \
108- needed to look them up. Because ethrex enables cache_index_and_filter_blocks, \
109- this value is the effective upper bound on RocksDB's resident memory footprint.\n \
104+ help = "RocksDB shared block cache size in bytes (default 12 GiB). \
105+ Bounds RocksDB resident memory; lower only on memory-constrained hosts.",
106+ long_help = "RocksDB shared block cache size in bytes. With cache_index_and_filter_blocks \
107+ enabled it holds data blocks plus the per-SST index and bloom-filter blocks, \
108+ so it is the effective ceiling on RocksDB's resident memory.\n \
110109 \n \
111- Default: 21474836480 bytes (20 GiB). Sized generously on purpose, to comfortably \
112- hold the filter and index working set on a fully- synced mainnet node (~5 GiB) \
113- plus the EVM's hot data set during block execution. Total ethrex process \
114- resident memory at this default is roughly 25-28 GiB on a fully-synced mainnet \
115- node (cache + memtables + per-block working memory) .\n \
110+ Default 12 GiB keeps the filter/index working set resident plus hot EVM state. \
111+ A sweep on a synced mainnet node (32 GiB cap) found 8-16 GiB all keep up with \
112+ head-following (filters resident, disk near-idle, no slow blocks); larger gives \
113+ no gain because the OS page cache backstops the uncompressed state CFs, and \
114+ ~8 GiB is the floor where the filter set starts to thrash .\n \
116115 \n \
117- LOWERING THIS VALUE WILL DEGRADE BLOCK-IMPORT PERFORMANCE. The filter and \
118- index working set is essentially fixed; when the cache cannot hold it plus a \
119- useful amount of hot data, EVM state reads spill to disk on every miss and \
120- block execution slows down sharply. Measured on a synced mainnet node:\n \
121- - 4 GiB cache : ~76% slower than the unbounded baseline (filters monopolize \
122- the cache, data is constantly evicted)\n \
123- - 20 GiB cache: at parity with the unbounded baseline (filters + working \
124- set both fit comfortably; this is the default)\n \
125- \n \
126- When to keep or raise the default:\n \
127- - Production mainnet validators and any node where block-import throughput \
128- matters should keep the default. Spare RAM is otherwise unused; the cache \
129- fills lazily up to this ceiling.\n \
130- - Future-proofing for databases beyond ~1 TB: raising this above 20 GiB \
131- leaves headroom as the on-disk state grows.\n \
132- \n \
133- When to lower it:\n \
134- - Resource-constrained hosts (testnet nodes, dev VMs, small validators) where \
135- the lower memory ceiling is worth the throughput cost. The lower bound for \
136- keeping up with mainnet under head-following load is workload-dependent and \
137- not currently characterized below 4 GiB.\n \
138- \n \
139- Value is in bytes. Example: 21474836480 = 20 * 1024^3 = 20 GiB. The \
140- ETHREX_ROCKSDB_BLOCK_CACHE_SIZE environment variable has the same effect.",
116+ Lower only on memory-constrained hosts, accepting reduced throughput. \
117+ ETHREX_ROCKSDB_BLOCK_CACHE_SIZE sets the same value.",
141118 help_heading = "Storage options" ,
142119 env = "ETHREX_ROCKSDB_BLOCK_CACHE_SIZE" ,
143120 ) ]
0 commit comments