Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions eclair-core/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,10 @@ eclair {
// down the node, we delete those rows in batches at regular intervals.
revoked-htlc-info-cleaner {
// Number of rows to delete per batch: a higher value will clean up the DB faster, but may have a higher impact on performance.
batch-size = 50000
batch-size = 500
// Frequency at which batches of rows are deleted: a lower value will clean up the DB faster, but may have a higher impact on performance.
interval = 15 minutes
// If you are frequently closing or splicing channels, you may want to increase the default interval if you're seeing IO performance issues.
interval = 1 seconds
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@ object RevokedHtlcInfoCleaner {
Behaviors.setup { context =>
context.system.eventStream ! EventStream.Subscribe(context.self)
Behaviors.withTimers { timers =>
timers.startTimerWithFixedDelay(DeleteBatch, config.interval)
timers.startSingleTimer(DeleteBatch, config.interval)
Behaviors.receiveMessage {
case ForgetHtlcInfos(channelId, beforeCommitIndex) =>
db.markHtlcInfosForRemoval(channelId, beforeCommitIndex)
Behaviors.same
case DeleteBatch =>
db.removeHtlcInfos(config.batchSize)
// We restart a new timer after each batch, instead of using a timer at fixed intervals.
// This ensures that we don't have DeleteBatch messages queuing up in the mailbox when the DB is busy.
timers.startSingleTimer(DeleteBatch, config.interval)
Behaviors.same
}
}
Expand Down