-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multi: replace per channel sigPool with global daemon level sigPool #2329
Conversation
@@ -1467,18 +1459,6 @@ func (lc *LightningChannel) createStateHintObfuscator() { | |||
} | |||
} | |||
|
|||
// Stop gracefully shuts down any active goroutines spawned by the | |||
// LightningChannel during regular duties. | |||
func (lc *LightningChannel) Stop() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: looks like we can also remove the now unused shutdown
and quit
members.
breacharbiter_test doesn't compile atm
|
In this commit, we remove the per channel `sigPool` within the `lnwallet.LightningChannel` struct. With this change, we ensure that as the number of channels grows, the number of gouroutines idling in the sigPool stays constant. It's the case that currently on the daemon, most channels are likely inactive, with only a hand full actually consistently carrying out channel updates. As a result, this change should reduce the amount of idle CPU usage, as we have less active goroutines in select loops. In order to make this change, the `SigPool` itself has been publicly exported such that outside callers can make a `SigPool` and pass it into newly created channels. Since the sig pool now lives outside the channel, we were also able to do away with the Stop() method on the channel all together. Finally, the server is the sub-system that is currently responsible for managing the `SigPool` within lnd.
5086c91
to
fa160f5
Compare
Fixed, PTAL! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran this on my testnet node and confirmed this reduced the amount of goroutines from one per channel to one globally. LGTM 🎯
In this commit, we remove the per channel
sigPool
within thelnwallet.LightningChannel
struct. With this change, we ensure that asthe number of channels grows, the number of gouroutines idling in the
sigPool stays constant. It's the case that currently on the daemon, most
channels are likely inactive, with only a hand full actually
consistently carrying out channel updates. As a result, this change
should reduce the amount of idle CPU usage, as we have less active
goroutines in select loops.
In order to make this change, the
SigPool
itself has been publiclyexported such that outside callers can make a
SigPool
and pass it intonewly created channels. Since the sig pool now lives outside the
channel, we were also able to do away with the Stop() method on the
channel all together.
Finally, the server is the sub-system that is currently responsible for
managing the
SigPool
within lnd.