Besu, an Ethereum execution layer client, is optimized for minimal database growth (7-8 GiB/week) with default parameter --bonsai-limit-trie-logs-enabled
. It can use RAM for more block processing speed.
If you have 64 GiB of RAM or more, you can add --Xplugin-rocksdb-high-spec-enabled=true
for better performance.
A long-running Besu DB, started before trie-log limit was enabled, will have sizeable trie log storage. This can be reduced
with a one-off prune using the storage trie-log prune
subcommand, assuming Besu 24.7.0
or later.
If you have 64 GiB of RAM or more, also add --Xplugin-rocksdb-high-spec-enabled=true
.
Edit the service:
sudo nano /etc/systemd/system/besu.service
It'll look something like this - your existing options and then the new parameter:
ExecStart=/usr/local/bin/besu/bin/besu \
--network=mainnet \
--data-path=/var/lib/besu \
--engine-jwt-secret=/var/lib/jwtsecret/jwt.hex \
--Xplugin-rocksdb-high-spec-enabled=true
If you have a long-running Besu DB, there will be accumulated trie logs in it. These can be pruned once.
Get into screen or tmux, so that the session won't be interrupted
screen
Stop the service
sudo systemctl stop besu
Prune Besu
sudo -u besu besu --data-path=/var/lib/besu storage trie-log prune
Once this is done, start the service
sudo systemctl start besu
For users of Eth Docker, these parameters are active by default. A long-running
DB can be pruned with ./ethd prune-besu
.