-
Notifications
You must be signed in to change notification settings - Fork 839
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
lower bound peer limit #4200
lower bound peer limit #4200
Conversation
…ledger#4170) Signed-off-by: Roman Vaseev <4833306+Filter94@users.noreply.github.com> Co-authored-by: Justin Florentine <justin+github@florentine.us> Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
@@ -228,7 +228,7 @@ public void callingVersionDisplayBesuInfoVersion() { | |||
public void callingBesuCommandWithoutOptionsMustSyncWithDefaultValues() throws Exception { | |||
parseCommand(); | |||
|
|||
final int maxPeers = 25; | |||
final int maxPeers = 100; |
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.
💪
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.
Looks good on first run through, some minor nitpicks
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java
Outdated
Show resolved
Hide resolved
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java
Outdated
Show resolved
Hide resolved
besu/src/main/java/org/hyperledger/besu/cli/DefaultCommandValues.java
Outdated
Show resolved
Hide resolved
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/config/RlpxConfiguration.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
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.
LGTM, a couple of log level suggestions.
The main point is to verify if and how the increased number of peers impacts the perfomance on small machines.
Fun fact:
playing with the configuration of remote-connections-max-percentage, is possible to launch Besu in a way that it never reaches the max peers upped limit, for example is lower limit is 50, upper limit is 100, and remote-connections-max-percentage is 10, the max number of connected peers should be 60
int DEFAULT_MAX_PEERS = 100; | ||
int DEFAULT_P2P_PEER_LOWER_BOUND = 64; |
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.
since this change max peers to 4 times the actual max, it could impact memory, cpu and lock contention, especially on resource constrained nodes
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.
yes I want to collect some metrics on this. maybe 25/50 would be a more sensible default.
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.
I'd be very cautious about raising the peer limit. From what I've seen besu works really well when it has 25 peers, it just tends to struggling to fill it's peer quota at times which is when it then struggles. Experimenting with different values by overriding them in config is probably better than changing the defaults in code before we've checked what impact it will have.
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.
Indeed. I've changed the defaults to min = max = 25 which is equivalent to current behavior.
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java
Outdated
Show resolved
Hide resolved
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java
Outdated
Show resolved
Hide resolved
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/network/DefaultP2PNetwork.java
Outdated
Show resolved
Hide resolved
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/RlpxAgent.java
Show resolved
Hide resolved
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>
…imit 3.138.85.163:
* introducing a lower bound on number of peers * added lower bound CLI option Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net> Signed-off-by: Roman Vaseev <4833306+Filter94@users.noreply.github.com> Co-authored-by: Roman Vaseev <4833306+Filter94@users.noreply.github.com> Co-authored-by: Justin Florentine <justin+github@florentine.us>
Added (experimental) CLI option for a lower bound for p2p peers. Similar to Teku's https://docs.teku.consensys.net/en/latest/Reference/CLI/CLI-Syntax/#p2p-peer-lower-bound
So we actively try to find more peers up to --Xp2p-peer-lower-bound, but still allow incoming connections until we hit --p2p-peer-upper-bound AKA --max-peers, only then we refuse incoming connections.
tableRefreshIntervalMs
is 30 minutesDocumentation
doc-change-required
label to this PR ifupdates are required.
Changelog