js-libp2p icon indicating copy to clipboard operation
js-libp2p copied to clipboard

AutoDial retries creeps up CPU usage over time

Open mkykadir opened this issue 1 year ago • 3 comments

  • Version: 1.2.3

  • Platform: Linux 7e698928f50f 5.15.49-linuxkit-pr #1 SMP PREEMPT Thu May 25 07:27:39 UTC 2023 aarch64 Linux

  • Subsystem: Connection manager

Severity: Medium

Description: I was relying on ConnectionManager's minConnections configuration's default value to be 0 but after an update this default value increased to 50. My P2P network does not have that much nodes, since minConnections become 50; autoDial keeps trying to dialing new nodes and this creates increase in CPU usage over time; which eventually overloads node.js event loop.

Steps to reproduce the error: Set minConnections config a high number; let node to autoDial over time and monitor Node's CPU usage over time. This can take time.

mkykadir avatar Feb 19 '24 12:02 mkykadir

set in config

connectionManager: {
      minConnections: 5
    },

abuvanth avatar May 10 '24 05:05 abuvanth

yes I already did that as a temporary fix but I don't think this auto dialing feature should creep up memory and cpu usage over time; its really hard to mitigate and identify the exact root cause

mkykadir avatar May 10 '24 08:05 mkykadir

yes I already did that as a temporary fix but I don't think this auto dialing feature should creep up memory and cpu usage over time; its really hard to mitigate and identify the exact root cause

yes

abuvanth avatar May 10 '24 09:05 abuvanth