go-ethereum/docs/cli
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
..
account.md Automatically generate markdown pages from bor CLI 2022-05-09 17:10:36 +02:00
account_import.md Merge branch 'qa' and 'master' into develop (#663) 2023-01-13 14:47:14 +05:30
account_list.md Merge branch 'qa' and 'master' into develop (#663) 2023-01-13 14:47:14 +05:30
account_new.md Merge branch 'qa' and 'master' into develop (#663) 2023-01-13 14:47:14 +05:30
attach.md Automatically generate markdown pages from bor CLI 2022-05-09 17:10:36 +02:00
bootnode.md add rpc.enabledeprecatedpersonal flag 2023-08-01 15:21:09 +05:30
chain.md Automatically generate markdown pages from bor CLI 2022-05-09 17:10:36 +02:00
chain_sethead.md Merge branch 'qa' and 'master' into develop (#663) 2023-01-13 14:47:14 +05:30
chain_watch.md Automatically generate markdown pages from bor CLI 2022-05-09 17:10:36 +02:00
debug.md internal/cli: add block tracing (#397) 2022-06-06 14:54:05 +05:30
debug_block.md Merge branch 'qa' and 'master' into develop (#663) 2023-01-13 14:47:14 +05:30
debug_pprof.md add rpc.enabledeprecatedpersonal flag 2023-08-01 15:21:09 +05:30
dumpconfig.md internal/cli: use config file for flags in new-cli, builder/files: update defaults (#457) 2022-07-29 17:12:30 -07:00
example_config.toml Update docs and add default config 2023-08-17 11:38:21 +05:30
fingerprint.md Automatically generate markdown pages from bor CLI 2022-05-09 17:10:36 +02:00
peers.md Automatically generate markdown pages from bor CLI 2022-05-09 17:10:36 +02:00
peers_add.md Merge branch 'qa' and 'master' into develop (#663) 2023-01-13 14:47:14 +05:30
peers_list.md Merge branch 'qa' and 'master' into develop (#663) 2023-01-13 14:47:14 +05:30
peers_remove.md Merge branch 'qa' and 'master' into develop (#663) 2023-01-13 14:47:14 +05:30
peers_status.md Merge branch 'qa' and 'master' into develop (#663) 2023-01-13 14:47:14 +05:30
README.md Merge branch 'qa' and 'master' into develop (#663) 2023-01-13 14:47:14 +05:30
removedb.md Merge branch 'qa' and 'master' into develop (#663) 2023-01-13 14:47:14 +05:30
server.md Add CLI flags to config LevelDB table/total sizes (#981) 2023-09-12 12:09:26 +02:00
snapshot.md Merge branch 'qa' and 'master' into develop (#663) 2023-01-13 14:47:14 +05:30
snapshot_prune-state.md Merge branch 'qa' and 'master' into develop (#663) 2023-01-13 14:47:14 +05:30
status.md Automatically generate markdown pages from bor CLI 2022-05-09 17:10:36 +02:00
version.md Automatically generate markdown pages from bor CLI 2022-05-09 17:10:36 +02:00