2

I am running my lnd node since about 60 days. Looking at the file channel.db, I found it grows currently about 500M per day:

btc@xxx:~/.lnd$ ls -al ./data/graph/mainnet/channel.db
-rw------- 1 btc btc 15776518144 Oct 19 14:31 ./data/graph/mainnet/channel.db

-rw------- 1 btc btc 16874332160 Oct 21 12:59 channel.db

What is in that file that needs 16GB and when will it stop growing? Running lnd 0.13.3 on i9-9900K CPU Ubuntu 20.04, bitcoin-core.

EDIT: New data from Oct 27 added:

It's now

-rw------- 1 btc btc 23279489024 Oct 27 09:20 channel.db

Growth of about 5 GB in 6 days with 2 amts forwarded and 1 new channel opened. Think I stop operating this. Someone with good alternatives to lnd?

1
  • This will be an open question, by generic idea the DB should never stop growing Nov 15, 2021 at 14:45

2 Answers 2

1

Like vincenzopalazzo commented - it never stops growing by design. Solution is to add

db.bolt.auto-compact=true

to the lnd config. Then the db gets "compacted" (means cleaned-up here) at lnd's startup. But take care for enough disk space. Why it sometimes grows so fast could not be revealed.

The complete discussion is here: https://github.com/lightningnetwork/lnd/issues/5705

0

lnd 0.15.0 introduced changes that slow down the speed at which your channel.db grows in size, i.e. each update is much smaller. With 0.15.1 you are able to run an optional migration (add a section [db] with db.prune-revocation=true to your lnd.conf), which replaces all old updates by this new format. Using this optional migration you can reduce the total size of your channel.db by a lot, if you have open channels that were active before you updated to lnd 0.15.0.

With lnd 0.15.0 you should make sure not to configure sync-freelist=true, i.e. use sync-freelist=false or remove this from your configuration. If set to true, several users noticed dramatically faster DB file size growth. See https://github.com/lightningnetwork/lnd/issues/6837.

Note that the actual size on disk only reduces if you run compaction, i.e. you need to apply the migration(s) and then restart lnd (again) to compact the DB file(s).

On my node (c-otto.de) I was able to reduce the size of my channel.db file from around 27 GByte to 1 GByte using the changes in 0.15.0 and 0.15.1.

Note that future releases of lnd will also reduce the size of your sphinxreplay.db (see https://github.com/lightningnetwork/lnd/issues/7107) and wtclient.db (see https://github.com/lightningnetwork/lnd/issues/7035) by quite a lot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.