Skip to content
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

Max peers config has no effect #4272

Open
haikoschol opened this issue Oct 22, 2024 · 2 comments
Open

Max peers config has no effect #4272

haikoschol opened this issue Oct 22, 2024 · 2 comments
Labels
A-debug issue requires detective debug work to figure out what's going wrong. C-chaotic Unpredictable nature of this task/changes makes its chaotic. P-low this is mostly nice to have. T-bug this issue covers unexpected and/or wrong behaviour.

Comments

@haikoschol
Copy link
Contributor

Describe the bug

The default value for the --max-peers CLI flag is 50. On a long-running bare metal Westend node, Grafana shows 479 under "Network total connected peers" and 957 under "Network total node connections". Either the configuration setting has no effect or the metrics are reported incorrectly.

Expected Behavior

The node should maintain no more than the maximum number of peer connections configured.

Current Behavior

The number of peers/connections keeps rising for a while until it stabilizes on a value much higher than the configured maximum. The number it stabilizes on seems to be correlated to the CPU/memory resources of the node.

To Reproduce

Steps to reproduce the behavior:

  1. run Gossamer without passing --max-peers to use the default of 50
  2. wait a while
  3. check the number of peers with curl -s localhost:9876/metrics | grep peer_count_total

Specification

  • go version: 1.23.2
  • gossamer version: development
  • gossamer commit hash: ce5200c3f19d84e77598ea9b19b5a49053e681de
  • operating system: Linux
@haikoschol haikoschol added T-bug this issue covers unexpected and/or wrong behaviour. A-debug issue requires detective debug work to figure out what's going wrong. P-low this is mostly nice to have. C-chaotic Unpredictable nature of this task/changes makes its chaotic. labels Oct 22, 2024
@haikoschol
Copy link
Contributor Author

This might be a symptom of #4293.

@haikoschol
Copy link
Contributor Author

haikoschol commented Nov 4, 2024

This might be a symptom of #4293.

It's not:

$ grep peers config.toml
# Minimum number of peers to connect to
min-peers = 5
# Maximum number of peers to connect to
max-peers = 50
# Comma separated list of peers to always keep connected to
persistent-peers = ""

This was on a machine that reports 316 "Network total connected peers" and 735 "Network total node connections".

However, those numbers are apparently wrong as well.

Number of all TCP connections of the gossamer process:

$ lsof -n -P -iTCP  | grep gossamer | wc -l
201

Number of all TCP connections in the ESTABLISHED state:

$ lsof -n -P -iTCP -sTCP:ESTABLISHED | grep gossamer | wc -l
195

So it seems that both the prometheus metrics are wrong and the config value is not honored by the network service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debug issue requires detective debug work to figure out what's going wrong. C-chaotic Unpredictable nature of this task/changes makes its chaotic. P-low this is mostly nice to have. T-bug this issue covers unexpected and/or wrong behaviour.
Projects
None yet
Development

No branches or pull requests

1 participant