ChainSafe / ChainSafe/gossamer

Max peers config has no effect

Open
#4,272 2 comments 0 reactions 0 assignees View on GitHub
A-debug C-chaotic P-low T-bug
Dominant language
Go
Stars
454
Forks
144
PR merge metrics
No merged PRs in 30d

Description

## 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.