discovery+routing: reduce number of active validation barrier jobs
In order to reduce high CPU utilization during the initial network view sync, we slash down the total number of active in-flight jobs that can be launched.
This commit is contained in:
parent
63fe8aec5b
commit
0a4de859a2
@ -833,7 +833,7 @@ func (d *AuthenticatedGossiper) networkHandler() {
|
|||||||
// We'll use this validation to ensure that we process jobs in their
|
// We'll use this validation to ensure that we process jobs in their
|
||||||
// dependency order during parallel validation.
|
// dependency order during parallel validation.
|
||||||
validationBarrier := routing.NewValidationBarrier(
|
validationBarrier := routing.NewValidationBarrier(
|
||||||
runtime.NumCPU()*10, d.quit,
|
runtime.NumCPU()*4, d.quit,
|
||||||
)
|
)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
2
peer.go
2
peer.go
@ -1148,7 +1148,7 @@ func (p *peer) queueMsg(msg lnwire.Message, errChan chan error) {
|
|||||||
select {
|
select {
|
||||||
case p.outgoingQueue <- outgoinMsg{msg, errChan}:
|
case p.outgoingQueue <- outgoinMsg{msg, errChan}:
|
||||||
case <-p.quit:
|
case <-p.quit:
|
||||||
peerLog.Debugf("Peer shutting down, could not enqueue msg.")
|
peerLog.Tracef("Peer shutting down, could not enqueue msg.")
|
||||||
if errChan != nil {
|
if errChan != nil {
|
||||||
errChan <- fmt.Errorf("peer shutting down")
|
errChan <- fmt.Errorf("peer shutting down")
|
||||||
}
|
}
|
||||||
|
@ -518,7 +518,7 @@ func (r *ChannelRouter) networkHandler() {
|
|||||||
|
|
||||||
// We'll use this validation barrier to ensure that we process all jobs
|
// We'll use this validation barrier to ensure that we process all jobs
|
||||||
// in the proper order during parallel validation.
|
// in the proper order during parallel validation.
|
||||||
validationBarrier := NewValidationBarrier(runtime.NumCPU()*10, r.quit)
|
validationBarrier := NewValidationBarrier(runtime.NumCPU()*4, r.quit)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
|
Loading…
Reference in New Issue
Block a user