go-ethereum/core
rroblak ebc7dc231a
Add CLI flags to config LevelDB table/total sizes (#981)
* Add CLI flags to config LevelDB table/total sizes

I wired up CLI flags to allow configuring LevelDB table and total sizes:
  - `--leveldb.compaction.table.size`, LevelDB SSTable file size factor in MiB (default: 2)
  - `--leveldb.compaction.table.multiplier`, multiplier on LevelDB SSTable file size (default: 1)
  - `--leveldb.compaction.total.size`, total size factor in MiB of LevelDB levels (default: 10)
  - `--leveldb.compaction.total.multiplier`, multiplier on LevelDB total level size (default: 10)

N.B. that the default values for these configs are exactly the same as
before this changset and so Bor behavior should not change unless these
flags are deliberately overridden. Bor/Geth inherited the default values
from [the `goleveldb`
defaults](126854af5e/leveldb/opt/options.go).

We (Alchemy) found it necessary to override these configs as follows to
keep Bor archive nodes tracking the canonical chain:
  - `--leveldb.compaction.table.size=4`
  - `--leveldb.compaction.total.size=20`

These overrides double the size of LevelDB SSTable files (2 MiB -> 4
MiB) and also the total amount of data in each level (100 MiB -> 200
MiB, 1,000 MiB -> 2,000 MiB, etc.). The idea is to have LevelDB read and
write data in larger chunks while keeping the proportional frequency of
compaction operations the same as in the original defaults defined by
Dean and Ghemawat.

Without these overrides we found that our archive nodes would tend to
fall into a "LevelDB compaction loop of death" where the incoming stream
of blockchain data could not be flowed into LevelDB's structure quickly
enough, resulting in the node blocking writes for long periods of time
while LevelDB's single-threaded compaction organized the data.  Over
time the nodes would fall farther and farther behind the canonical chain
head, metaphorically dying a slow node's death.

These configs can be changed on existing node databases (resyncing is
not necessary). LevelDB appears to work correctly with SSTable files of
different sizes. Note that the database does not undergo any sort of
migration when changing these configs. Only newly-written files (due to
new data or compaction) are affected by these configs.

* Update docs

* Adjust line spacing for linter

* Replace map with `ExtraDBConfig`

* Rename `LevelDbConfig` to `ExtraDBConfig`

* Regenerate docs
2023-09-12 12:09:26 +02:00
..
allocs fix typo 2021-09-23 10:56:17 +05:30
asm dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
beacon dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
blockstm Merge branch 'develop' into mardizzone/upstream-merge 2023-07-24 14:19:30 +05:30
bloombits dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
forkid dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
rawdb Add CLI flags to config LevelDB table/total sizes (#981) 2023-09-12 12:09:26 +02:00
state Revert "add : mutex for stateObjects" 2023-08-04 12:26:11 -07:00
tests dev: fix: all remaining lint issues 2023-06-19 11:39:59 +02:00
triecache version change for milestones 2023-08-29 17:50:05 +05:30
txpool Merge tag 'v0.5.0-beta-6' of github.com:maticnetwork/bor into arpit/merge-latest-branch 2023-08-29 17:44:54 +05:30
types fix : TxDependency 2023-07-28 18:02:53 +05:30
vm dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
.gitignore Renamed chain => core 2014-12-04 10:28:02 +01:00
bench_test.go Add CLI flags to config LevelDB table/total sizes (#981) 2023-09-12 12:09:26 +02:00
block_validator.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
block_validator_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
blockchain.go all: implement milestones (#961) 2023-08-28 18:42:21 +05:30
blockchain_bor_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
blockchain_insert.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
blockchain_reader.go all: implement milestones (#961) 2023-08-28 18:42:21 +05:30
blockchain_test.go all: implement milestones (#961) 2023-08-28 18:42:21 +05:30
blocks.go use go-ethereum for better forked-bor release 2020-11-13 09:21:48 +05:30
bloom_indexer.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
bor_blockchain.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
bor_events.go fixes 2021-12-06 14:25:33 +05:30
bor_fee_log.go fix : TestGraphQLConcurrentResolvers 2023-07-18 18:15:06 +05:30
chain_indexer.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
chain_indexer_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
chain_makers.go fix : testcase : config, addTxWithChain, burnAmount 2023-06-26 14:07:31 +05:30
chain_makers_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
dao_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
error.go Merge qa to develop (#814) 2023-04-10 16:21:18 +05:30
events.go Minor Refactor 2021-12-03 17:28:53 +05:30
evm.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
forkchoice.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
forkchoice_test.go all: implement milestones (#961) 2023-08-28 18:42:21 +05:30
gaspool.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
gen_genesis.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
gen_genesis_account.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
genesis.go fix : test-integration 2023-07-17 16:39:12 +08:00
genesis_alloc.go all: remove support for Ropsten (#26644) 2023-02-09 10:03:00 +02:00
genesis_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
headerchain.go dev: fix: all remaining lint issues 2023-06-19 11:39:59 +02:00
headerchain_test.go dev: fix: all remaining lint issues 2023-06-19 11:39:59 +02:00
mkalloc.go build: upgrade to go 1.19 (#25726) 2022-09-10 13:25:40 +02:00
parallel_state_processor.go fix : TxDependency 2023-07-28 18:02:53 +05:30
rlp_test.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
sender_cacher.go dev: fix: most of wsl lint issues 2023-06-15 15:48:26 +02:00
state_prefetcher.go dev: fix: all remaining lint issues 2023-06-19 11:39:59 +02:00
state_processor.go core: restore AddFeeTransferLog post miner tipping 2023-07-18 13:52:36 +05:30
state_processor_test.go fix : freezer, TestStateProcessorErrors 2023-07-03 17:11:56 +05:30
state_transition.go core,eth/tracers: fix TestPrestateWithDiffModeTracer 2023-07-06 15:51:52 +05:30
types.go dev: add: merge develop in upstream-merge 2023-06-13 12:37:20 +02:00