Disk Optimization
CosVM Node Configuration for Disk Usage Optimization
When setting up a validator node for CosVM, it's crucial to optimize configuration settings to reduce disk space requirements while maintaining essential functionalities. The blockchain database tends to expand over time due to factors like block speed and transaction volume. However, by customizing certain settings, you can significantly lower the disk usage without compromising the node's performance.
Indexing Optimization
If your node doesnβt require transaction querying, disabling indexing can save substantial disk space. To achieve this, modify the config.toml
file:
Note: If you disable indexing on a synced node, manually delete the index located at data/tx_index.db/
under the database directory.
State-Sync Snapshots
Ensure that state-sync snapshots are disabled to prevent unnecessary data accumulation. In the app.toml
file, set:
Note: Enabling state-sync could facilitate rapid syncing for new nodes but sacrifices historical data.
Configure Pruning
Customize pruning settings to optimize disk usage over time. Adjust the pruning configurations in config.toml
:
Caution: Avoid setting pruning-keep-recent = "0"
to prevent potential database corruption if the CosVM node is unexpectedly terminated.
Logging Optimization
Reduce unnecessary log data by adjusting the log level. Initially set to info, switch it to a lower level after confirming successful node syncing in config.toml:
Ensure proper log rotation settings for efficient log management.
Results Comparison
Here's a comparison of disk usage after two weeks on the CosVM mainnet:
Default Configuration:
Optimized Configuration:
Implementing these customized configurations reduces disk usage significantly from 90GB to 17GB while ensuring essential data is retained for optimal CosVM node performance. Adjustments like disabling unnecessary features, optimizing pruning, and minimizing logs can effectively manage disk space without compromising the node's functionality.
Last updated