besu icon indicating copy to clipboard operation
besu copied to clipboard

Increase peer limit

Open jframe opened this issue 4 months ago • 7 comments

Increase the peer limit in Besu from 25 peers. As part of this we need investigate what appropriate limit would be and test for any negative impacts.

jframe avatar Oct 13 '25 00:10 jframe

hey @jframe , did some digging regarding this, was thinking to inc the peer limit to say 2x the current value and then test, negative impacts can include :

  • -> when at the limit, Besu disconnects the “least useful” peers; with a higher cap, churn and log noise can rise during busy periods (unlikely tho, coz we enforceConnectionLimits in EthPeers.java )
  • -> filling a bigger target causes more discovery traffic and dials initially
  • -> sync slowdown from trailing peers (although this we handle, we cap trailing peers to a fraction of the limit to preserve headroom for useful peers)
  • -> more peers means more blocks / more txns , basically increased gossip
  • -> increased cpu usage

if this sounds apt to you, i can proceed with the testing part for a new limit of 50 to start with?

isuniverseok-ua avatar Nov 03 '25 07:11 isuniverseok-ua

@Matilda-Clerke What are your thoughts on the analysis?

jframe avatar Nov 05 '25 07:11 jframe

Sounds like a reasonable analysis of the potential issues. I suggest also experimenting with increasing the number of threads used in syncing (--Xsynchronizer-downloader-parallelism option)

Matilda-Clerke avatar Nov 07 '25 00:11 Matilda-Clerke

@isuniverseok-ua Are you still wanting to pick this up? If so I can assign this to you.

jframe avatar Nov 11 '25 23:11 jframe

ya @jframe you can assign it to me

isuniverseok-ua avatar Nov 12 '25 06:11 isuniverseok-ua

hi @jframe , tried to increase the peer limit to 50, while spinning a local devnet using kurtosis (ref - https://github.com/hyperledger/besu/wiki/Devnet-Testing-and-Tooling) i got this rpc error -

rpc error: code = Unavailable desc = connection error: desc = "transport: failed to write client preface: write tcp x.x.x.x: 62503->x.x.x.x: 62485: use of closed network connection

tried restarting the engine, tearing down enclave, also checked the logs but couldn't find a wayaround, do you have any idea of this, or is there any other simpler way to spin a devnet, wanted to track some metrics for the case when i increase the peer limit to 50

isuniverseok-ua avatar Nov 25 '25 08:11 isuniverseok-ua

Not sure on that error. Probably best to ask that question in besu discord channel

jframe avatar Nov 26 '25 01:11 jframe