Compacting the channel.db file
What does it mean and why it is so important. If you are a node runner, you need to checkout this short article.
The channel.db file (or BOLT db) stores the complete record of payments processed by your LND node, which encompasses failed payments, payment probes, and failed HTLC from payments.
The file will continue growing more and more, so you must pay attention to size on disk. This may lead to problems if growing too much (more than 6-8 GB).
You should compact and prune it when needed. Pruning means marking payment records for deletion. Compaction instead is the removing of the marked records from the database. This obviously makes its size smaller.
In order to compact the channel.db file the node can't be running. For that reason, you cannot pack it ongoing.
You have a flag in LND called auto-compaction. this flag can be set and in this case every time your node starts up it will attempt to compact your database files (maximum once every 24 hours). This can be used to run a compaction on your database. Please be aware that enabling this flag does add additional time to a node starting up.