Skip to content

Fix performance issues when peers spam us#8983

Open
rustyrussell wants to merge 4 commits intoElementsProject:masterfrom
rustyrussell:guilt/gossipd-connectd
Open

Fix performance issues when peers spam us#8983
rustyrussell wants to merge 4 commits intoElementsProject:masterfrom
rustyrussell:guilt/gossipd-connectd

Conversation

@rustyrussell
Copy link
Contributor

  1. Limit queues in gossipd for pending incoming gossip.
  2. Limit incoming messages to about 1MB per second per peer.

This should be enough even on a Raspberry Pi.

Reported-by: Erick Cestari

Uses found and changed by Claude.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…ers.

Clarify the case where we only want to log once.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We already limited pending_ann_map and early_ann_map to 10,000 entries:
do the same for pending_nannounces, pending_cupdates and early_cupdates.

Add CI_UNEXPECTED so CI gets upset if this happens unexpectedly.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Decryption is pretty efficient, but incoming traffic can bog down
connectd, especially on smaller nodes, so simply limit it to 1MB per
second.

Changelog-Fixed: connectd: throttle incoming peers to give fairer peer handling under stress.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell rustyrussell added this to the v26.04 milestone Mar 25, 2026
@madelinevibes madelinevibes added the 26.04 RC This PR needs to go into the next release candidate for 26.04 label Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

26.04 RC This PR needs to go into the next release candidate for 26.04

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants